I have a partial named "_mailing_list.rhtml" ~
<% remote_form_for(:recipient, :url=> { :controller => 'recipients', :action => 'create' }) do |f| %> <p> Email: <%= f.text_field :email_address, :size => 20 -%> <%= submit_tag "Subscribe", :disable_with => "Please wait..." %> </p> <% end %>
I have a create action in my recipients controller ~
def create @recipient = Recipient.new(params[:recipient]) @recipient.save end
I have a create.rjs ~
page[:mailing_list].reload
The Recipient ActiveRecord correctly updates the database and the RJS creates the JavaScript I want, but rather than executing the JavaScript, I see it printed to my screen and the URL changed to / recipients/create
What am I doing wrong?
Thanks, Dan