Reputation: 5589
In my application I call the controller foo that sets a variable var to a value and then want to render the the div container with id bar_var. Therefore I have a js.erb file with the code
$('#bar_var').html("<%= escape_javascript(render :partial => ....)
How can I pass the variable parameter var to differ between container bar_1 and bar_2 perhaps? The bar parameter is passed via get parameters and also via ruby class variables.
Upvotes: 0
Views: 459
Reputation: 83680
As far as your question is kind of unclear I will suggest this
$('#bar_<%= params[:var] %>').html("<%= escape_javascript(render :partial => ....)
Upvotes: 1