Last active
August 29, 2015 14:01
-
-
Save bricker/9151903b99a2e312c960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
def needs_proof? | |
self.util_one.blank? && self.letter_approved | |
end | |
# ... etc | |
end | |
class UsersController < ApplicationController | |
def show | |
@user = User.find(params[:id]) | |
render "userinfo" and return f current_user.admin? | |
render "letter" and return if current_user.letter.blank? | |
render "proof" and return if current_user.needs_proof? | |
# ... etc | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment