Render partial from model?

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

Not in a month of mondays. Cache sweepers may be of interest to you.

Fred

Frederick Cheung wrote:

Frederick Cheung 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

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!