This code doesn't work as expected:
wants.js do
render :update do |page|
page.select('#link-1 .details').first.replace :partial => 'edit'
end
end
When I pass options for render directly to the replace function, the hash is converted to string and passed to the browser resulting in alert saying that html.stripScripts() is not a function.
However, when i pre-render partial using render_to_string, it works as expected:
wants.js do
partial = render_to_string :partial => 'edit'
render :update do |page|
page.select('#link-1 .details').first.replace partial
end
end
Also when I explicitly select DOM element by id, everything works:
page['link-1'].replace :partial => 'edit'