I usually do it like second option (less code possible in render block),
but not sure which is better and why.
--
Jonathan Hernández Velasco aka jBilbo
http://jhernandez.gpltarragona.org
President de GPLtarragona ;; http://www.gpltarragona.org
The inherent problem with render :text, :inline, or :update is that it
is clearly putting view code in the controller. View code (anything
describing html, css, javascript or changes to them) should simply not
be in the controller.
Look at this code
render :update do |page|
page['list'].replace_html "some new html"
page['list'].replace_html "some new html"
page['list'].replace_html "some new html"
page['foo'].visual_effect :highlight
end
Clearly this type of code is all view-based and belongs in the view
folder within an rjs template.
The answer is to do something like this:
if condition1
render :action => "cond1.js.rjs"
else
render :action => "cond2.js.rjs"
end
--
Posted via http://www.ruby-forum.com/.
--
Anil
http://anilwadghule.com