Skip to content

Instantly share code, notes, and snippets.

@jkamenik
Created October 26, 2011 13:45
Show Gist options
  • Save jkamenik/1316395 to your computer and use it in GitHub Desktop.
Save jkamenik/1316395 to your computer and use it in GitHub Desktop.
Cancan
def super_user
can :see_user, Ticket
end
def index
search = { :page => params[:page] }
search[:include] = :user if can? :see_user, Ticket
@tickets = @tickets.where(conditions).order('created_at desc').search(params[:search],search)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment