Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created February 25, 2011 14:57
Show Gist options
  • Select an option

  • Save DCarper/843893 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/843893 to your computer and use it in GitHub Desktop.
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
- 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