Skip to content

Instantly share code, notes, and snippets.

@Chryus
Created March 17, 2014 14:18
Show Gist options
  • Save Chryus/9600004 to your computer and use it in GitHub Desktop.
Save Chryus/9600004 to your computer and use it in GitHub Desktop.
Example of using conditional logic to check for admin status via Devise
<% if current_user.try(:admin?) %>
<%= link_to 'Edit', edit_event_path(event) %>
<%= link_to 'Destroy', event, confirm: 'Are you sure?', method: :delete %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment