like this then? I'm checking for existence of id to deal with the index
action, i think this might be OTT though?
---
def find_baby_name
@baby_name = BabyName.find(params[:id]) if params[:id]
if @baby_name
if @baby_name.user == current_user
true
else
flash[:notice] = "Not authorised."
redirect_to root_url
return false
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.