Re: calling a partial from within a model / model''s method?

Joel Oliveira
Mon, 24 Nov 2008 13:37:41 -0000

Hey Nick!

First - thanks for the reply.

Second - the reason why I''m trying to do this is to allow whatever type
of
widget model I''m creating to render its own particular partial, in the
context of the "area" a user will place it - header, footer, sidebar,
etc.
I thought that calling a helper to weed out the objects for a particular
"area" and then letting the model call its partial on its own, would
be the
easier way to do it, despite the normal MVC rules.  I know it''s against
the
rules - so I''m wondering if there''s an easier way?

Any input would be appreciated! :)

Thanks!

- Joel

On Sun, Nov 23, 2008 at 9:38 PM, Nick
<nick-qGbiljoI0DQkmLvzuZlaBw@public.gmane.org> wrote:

>
> On Nov 23, 9:31 pm, "Joel Oliveira"
<joel.olive...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hey everyone,
> >
> > *snip*
> >
> > Thanks everyone!
> >
> > - Joel
>
> Hi Joel. I''m not quite sure why you want to render partials or
> templates from within your model(s). I''m sure you have some good
> reasons, but sometimes there''re ways of accomplishing what you
want
> without violating the "rules" of the MVC design pattern.
>
> Would you mind explaining in more detail why your model(s) need to
> render partials and/or templates?
>
> Cheers,
> Nick
> >