2009/9/20 mlittle <mdlit...@gmail.com>: > > Maybe I'm just going about my application in the wrong way. I'm new > with rails and I'm trying to make sure that Child and Dog can only be > viewed my the person who creates them. That's how I ended up with > resources 3 deep. My resources are actually called User, Child and > Parent. User is also current_user (I use restful_authentication) and > all the resources are created by the current_user. My routes are basic > but are 3 resources deep: User > Child > Parent. So, I reference each > in my controllers by current_user.child and when I started trying to > access current_user.child.parent, things started to break because I > really don't know how to do this. I've read some articles that say > more then 1 level deep is not a good idea but I don't how to make sure > records aren't viewed by other users that they didn't create. I've > bought more book then I probably should and am getting frustrated. > Maybe my method of making sure records are not viewed by other users > is the wrong approach. >
I am still confused about your model relationships. Could you post the class definitions please showing the has and belongs to relationships? Colin --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---