Hi, I know that this goes against MVC, but is there any way to render a partial from a model? The reason for me wanting to do this is that the caching logic is quite complex and I would like to keep it in the model. Thanks, GiantCranes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 28, 8:06 pm, Giant Cranes <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I know that this goes against MVC, but is there any way to render a > partial from a model? The reason for me wanting to do this is that the > caching logic is quite complex and I would like to keep it in the model. >Not in a month of mondays. Cache sweepers may be of interest to you. Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Apr 28, 8:06�pm, Giant Cranes <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Hi, >> >> I know that this goes against MVC, but is there any way to render a >> partial from a model? The reason for me wanting to do this is that the >> caching logic is quite complex and I would like to keep it in the model. >> > Not in a month of mondays. Cache sweepers may be of interest to you. > > FredThanks, I''ll take a look. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> > > On Apr 28, 8:06 pm, Giant Cranes <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Hi, >> >> I know that this goes against MVC, but is there any way to render a >> partial from a model? The reason for me wanting to do this is that the >> caching logic is quite complex and I would like to keep it in the model. >> > Not in a month of mondays.Except if you use Builder::XmlMarkup to generate arbitrary XHTML in the model, forsaking the helpers like h() that the vi > Cache sweepers may be of interest to you.> > Fred > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote: > Giant Cranes wrote: >> I know that this goes against MVC, but is there any way to render a >> partial from a model? The reason for me wanting to do this is that the >> caching logic is quite complex and I would like to keep it in the model. >> > Not in a month of mondays. Except if you use Builder::XmlMarkup to generate arbitrary XHTML in the model, forsaking the helpers like h() that the View give you. And-or if you build arbitrary strings that your controller won''t mind calling render :inline => on. > Cache sweepers may be of interest to you. Ayup. There are perfectly MVC reasons to concoct HTML in the Model. The faintest wisp of convenience might be one of them, but thwarting a cache system is not. If the problem''s in the View, fix it in the View! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---