Re: Hatred towards Nested Polymorphic Paths

Obie Fernandez
2007-07-09T04:27:16Z

On 7/8/07, Michael Koziarski <michael@koziarski.com>
wrote:
>
> > Agree. some_model/1/other_model/2 is a lame way to refer to
join_model/1.
>
> Putting polymorphism aside, what about:
>
> posts/1/comments/34
>
> Which then lets me do
>
> @post = user.posts.find(params[:post_id])
> @comment = @post.comments.find(params[:id])
>
> Does that suck?

No, it doesn''t suck at all, and that snippet represents a Rails
"best
practice", doesn''t it?

Frankly, I haven''t seen any compelling arguments against multi-level
nested routes yet. Not to mention that If you have public-facing URLs,
then the realities of SEO mean that the more relevant information you
can cram into your URLs the better.

Cheers,
Obie


>
>
> --
> Cheers
>
> Koz
>
> >