how do you emulate what rjs does in rails with form.request?

0 views
Skip to first unread message

patrick

unread,
Oct 30, 2009, 12:33:51 PM10/30/09
to Prototype & script.aculo.us
Hi,

So, if I have a controller action with an rjs template that does
page.replace_html on several different elements, how can I accomplish
this same update of multiple elements in my regular js functions?

For example, I have a controller: and in it I do:
def some_action
render :partial => 'some_path/blah'
end

... Then in my js code, I do:
$('my_form').request({onComplete:
function(r) {
$('some_div').update(r.responseText);
}
});

But how could I do the same thing but update 3 or 4 divs with
different partials?

Is rjs really the best way to deal with this sort of thing?

-patrick

Alex McAuley

unread,
Oct 30, 2009, 2:20:24 PM10/30/09
to prototype-s...@googlegroups.com
Split the response or make it a JSON response and loop it or...

evalScripts:true

and have the serverside do the updating

Alex Mcauley
http://www.thevacancymarket.com
Reply all
Reply to author
Forward
0 new messages