Topic: HTML rendered instead rjs
Hello,
I have a problem with an AJAX update of a page.
I generated a custom controller (with rails g controller showcases) and I prepared a form_tag in the new view ...
<%=form_tag (url_for(:controller => "showcases", :action => :new), :remote => true, :method => :post) do%>
...
<%= submit_tag "Confirm" %>
<%end%>
...
<div id="test">foo</div> <!-- this is for testing -->and I have the controller with the new action implemented:
def new
...
respond_to do |format|
format.html
format.js
end
endI also implemented the new.rjs.erb file with a very simple task, just to test the call:
page.replace_html('test', "hello")It seems (I think) that the rjs is not called because in the console I see:
Started GET "/showcases/new" for 127.0.0.1 at Mon Sep 26 15:45:22 +0200 2011
Processing by ShowcasesController#new as HTML
Rendered showcases/new.html.erb within layouts/application (4.4ms)
Completed 200 OK in 12ms (Views: 10.9ms | ActiveRecord: 0.0ms)Why is rendered the showcases/new.html.erb instead of call showcases/new.rjs.erb file?
Thanks to all