Skip to content

Instantly share code, notes, and snippets.

@anathematic
Created December 8, 2009 03:40
Show Gist options
  • Save anathematic/251386 to your computer and use it in GitHub Desktop.
Save anathematic/251386 to your computer and use it in GitHub Desktop.
## View
<% if current_user_authorised?(@venue, current_user) %>
Foo~
<% end %>
## Helper
def current_user_authorised?(record, current_user)
current_user ? (true if record.user == current_user or current_user.admin?) : false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment