Topic: Parameters to RJS
I am working on my first "real" project in rails. I am rendering partials through link_to_remote using RJS to update a <div> without a reload. Allright, my question is this. Is there anyway to write a generic RJS file that accepts a div (for elementID) and a partial?
For instance I have the following:
page.replace_html 'display_left', :partial => 'philosophy'
page.visual_effect :highlight, 'display_left', :duration => 2, :startcolor => "\'#d7d6dc\'", :endcolor => "\'#f5f2f7\'"
Is it possible to rewrite that RJS so that it accepts 'display_left' and 'philosophy' as parameters instead?
Hope I wasn't too unclear in what I mean...