I would like two .js.erb files, named "create" and "update" to load and be executed to replace a table in one of my views with an updated partial after a form is submitted.
The files both contain the following (they are identical)
$('table#rating').replaceWith("<%= escape_javascript(render :partial => 'home/rating') %>");
However I am unsure where to put the .js.erb files (in the same view as my html.erb page?) and how to load/trigger them when the form submits. Any help would be appreciated.