Hi.
I've got place in my layout for newest product - it's set by candle model.
I would like to display it when candle controller is called, but when others (like page controller,contact controller) too - is it possible, to show it without loading candle model in each controller ?
I'm showing my newest candle with code like this:
<p><span><%= link_to newest.name, {:controller=>'candle',:action=>'showCandle',:id=>newest.category,:candle=>newest.name} %></span></p>
I guess, that I can create new model (for ex. blocks model) and there set $this->newest variable - however, I can't use there Candle model, can I ?
Sorry for my language errors - I'm still learning English ;)
you could do this in a helper and/or partial. just
Ak::import('Candle');
then instantiate the model.
1 to 2 of 2