Skip to content

Instantly share code, notes, and snippets.

@bricker
Last active August 29, 2015 14:01
Show Gist options
  • Save bricker/9151903b99a2e312c960 to your computer and use it in GitHub Desktop.
Save bricker/9151903b99a2e312c960 to your computer and use it in GitHub Desktop.
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