Elliott Blatt wrote:
I would like to be
able to select a particular RJS file to excute based on the results of
In the simplest terms, this is what I'd like to accomplish:
if case == a
Now Rails has a convention that says, "if no render statement is
defined, look for and .rhtml or .rjs file to execute based on the name
of the action; i.e reply.rjs. I can seem to find a particluar command
that will allow me to specify which RJS to use.
The clue is in "if no render statement is defined..."
You need to use the 'render' method, and in particular the :action
render(:action => :reply_a)
render(:action => :reply_b)
The documentation's here:
(Also, just curious, does anyone know of a way to do logic inside an RJS
An RJS template is just pure Ruby, so you can use the usual