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

On Apr 28, 8:06 pm, Giant C. [email protected]
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

Frederick C. wrote:

On Apr 28, 8:06�pm, Giant C. [email protected]
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

Thanks, I’ll take a look.

Frederick C. wrote:

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.

Frederick C. wrote:

Giant C. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs