I'm having an issue with rails not actually executing JS in a template. I have a respond to block in my controller that is like this:
respond_to do |format|
format.js {}
end
and the proper file in the views, but when it renders it actually just prints the JS, like the mime type is wrong. (the file is add_item.js.erb
)
For example if I had this as a test in my view:
<%= "alert('running');" %>
but when that action gets executed in the controller the page redirects and the HTML out put is the JS itself:
alert('running');