Re: [Rails] is equal operator to check current user is owner

2011-02-12 Thread Colin Law
On 11 February 2011 22:40, msaspence msaspe...@gmail.com wrote: I'm want to restrict access to an object show action to the owner in my action I have this def show    @thing = Thing.find(params[:id])    if current_user @thing.owner == current_user Not related to your problem, but just

[Rails] is equal operator to check current user is owner

2011-02-11 Thread msaspence
I'm want to restrict access to an object show action to the owner in my action I have this def show @thing = Thing.find(params[:id]) if current_user @thing.owner == current_user respond_to do |format| format.json { render :json = @thing } end else render