Hi, I''m testing ajax in a restful resource. In a non-restful controller, ajax worked fine. But in a restful controller, ajax didn''t work as I expected. I did the following. 1. script/generate scaffold user name:string 2. rake db:migrate 3. In users_controller.rb, I added one line to the create method''s response_to block. format.js { render :layout => false } 4. In index.html.erb, I added an ajax form. <% remote_form_for :user, User.new, :url => users_path do |f| %> <%= f.text_field :name %> <%= submit_tag "Create" %> <% end %> 5. I created create.js.rjs and wrote a simple rjs code. page.alert("Test") When I clicked "Create" button, format.html was executed instead of format.js. So I changed the :url part. :url => formatted_users_path(:js) Now format.js is called but it displays the JavaScript code on a new page. It''s supposed to be evaluated, right? What did I do wrong? Thanks. Sam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---