Hello,
A user can only edit its own post, so I use the following to check if a user can enter the edit form:
def edit
@post = Load.find(:first, :conditions => { :user_id => session[:user_id], :id => params[:id]})
rescue ActiveRecord::RecordNotFound
flash[:notice] = "Wrong post it"
redirect_to :action => 'index'
end
But it is not working, any ideas what I am doing wrong?