Created
February 25, 2011 14:57
-
-
Save DCarper/843893 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 BracketsHelper | |
| # YIELD TO THE GIVEN BLOCK IF THE USER OWNS THE BRACKET | |
| # | |
| # USED TO INCLUDE/EXCLUDE CONTENT FROM USER / OWNER | |
| # | |
| def owner_only(&content) | |
| if @bracket && @bracket.owner == @user | |
| yield | |
| end | |
| end |
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
| - owner_only do | |
| = link_to "My Control Panel", edit_bracket_path(@bracket), :title => 'My Control Panel' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment