Re: Hatred towards Nested Polymorphic Paths

Daniel N
2007-07-09T04:33:16Z

On 7/8/07, Josh Peek <joshpeek@gmail.com> wrote:
>
>
>
>
> On Jul 7, 1:22 pm, "Daniel N" <has....@gmail.com> wrote:
> > I can''t pastie it unfortunately but it.  But I believe it
goes for any
> time
> > you use a has_many :through relationship with additional data in the
> join
> > table.  Without both sides of the join, you can''t identify
join, and
> > therefore don''t have access to the extra data.
>
> You identify the join with the id of the join model. Thats the purpose
> of using has many though, exposing an actual model. If you could
> pastie on example, I could show you how to model it better.



It''s getting quite large.  I''ve included relevant models,
controllers and
views, limited to an example of the purpose at hand. The index view of the
clips controller.

The only time I access clips via a nested route is by the ClipsController -
index, and show methods.  Other than that I don''t require the nested
resources at the moment.

I''m actually very apprehensive about putting this out for public crit,
but
I''m more interested in how to model this properly for this project and
future ones, so please be gentle ;)  There are some very messy parts in the
user model associations to access clips.  The funny thing is, for all the
ugliness they provide, I''m not actually using the methods anywhere yet.

If I''ve left out any important aspects of the code let me know.

http://pastie.caboo.se/77228

-Daniel