Skip to content

Instantly share code, notes, and snippets.

@infinityrobot
Created May 6, 2010 23:12
Show Gist options
  • Select an option

  • Save infinityrobot/392802 to your computer and use it in GitHub Desktop.

Select an option

Save infinityrobot/392802 to your computer and use it in GitHub Desktop.

Revisions

  1. infinityrobot created this gist May 6, 2010.
    3 changes: 3 additions & 0 deletions application_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    def authorised?
    true
    end
    8 changes: 8 additions & 0 deletions items_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    def authorised?
    @item = Item.find(params[:id])
    if @item.user != current_user
    flash[:error] = "You can only edit your own items!"
    redirect_to @item
    return false
    end
    end