I'm facing an issue with a form inside a popup window. Here's how it looks:
<%= form_tag "/controller/action", :method => :get, :remote => true do %>
...
<% end %>
Within my controller:
respond_to do |format|
format.js
end
Upon submission, I attempt to modify elements of the parent window using action.js.erb
:
window.opener.$('#some-div').html('<div class="flash notice">...</div>');
Alternatively, without jQuery:
window.opener.document.getElementById('some-div').innerHTML = '<div class="flash notice">...</div>';
In both scenarios, I successfully display the flash message in my desired div, but also the entire content of action.js.erb as text.
What could be causing this issue?