Created
May 20, 2016 00:22
-
-
Save mfifth/b933d5981aeaac9bb43a83b2c1850470 to your computer and use it in GitHub Desktop.
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
| module ApplicationHelper | |
| def admins_only(&block) | |
| block.call if current_user.try(:admin?) | |
| end | |
| def author_only(&block) | |
| block.call if current_user == @topic.author.email | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment