Thanks for the advice, I didn't know about cancan, it looks like it'll
make things a lot easier for me. As for the resources, that's the case
except when I want to create a new resource. The to-be child doesn't
have a parent yet since it doesn't exist at the moment so I'd have to
pass the parent or its ID when I want to create a new resource. But in
general is there a limit to how many levels an app should have?

On Jan 3, 9:44 am, Philip Hallstrom <phi...@pjkh.com> wrote:
> > My app currently is working but I'm a little OCD about conforming to
> > best practices so I'd like to get a few things cleared up.
>
> > 1. I have quite a lot of before_filters to restrict certain parts of
> > the site to some users, and a lot of my controllers use very similar
> > authorization code. Here's an example:
>
> You might look into a gem like cancan or something similar to handle this for 
> you...
>
> > Regarding nested resources, is it bad to have more than 2 levels? My
> > deepest level is 3 and it's a bother to manage it all, but if I
> > separate them then I'd still have to get the IDs of their "parents"
> > anyways by passing them in URLs or something.
>
> Why can't you get the parent from the child itself?
>
> Parent has many Children...
>
> c = Children.find(123)
> c.parent => instance of Parent
>
> ?
>
> -philip

-- 
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-t...@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.

Reply via email to