Created
March 17, 2014 14:18
-
-
Save Chryus/9600004 to your computer and use it in GitHub Desktop.
Example of using conditional logic to check for admin status via Devise
This file contains hidden or 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
<% 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