views:

15

answers:

2

Hi,

I am trying to create a contact form using the remote_form_tag, but I cannot get it to work.

    <% remote_form_tag :url => {:action => :email_create} do %>
     <%= label_tag 'name', 'Name: ' %><%= text_field_tag :name %>
     <%= label_tag 'email', 'Email: ' %><%= text_field_tag :email %>
     <%= label_tag 'message', 'Message: ' %><%= text_area_tag :message %>
     <%= submit_tag 'Send' %>
    <% end %>

The problem is that code throws errors.

Anyone have any idea what the problem is?

Thank you

+1  A: 

remote_form_tag has been removed in Rails 3. You need to use form_tag in combination with the :remote => true option.

Simone Carletti
A: 

In Rails 2.3.x, there is no remote_form_tag method.

Use form_remote_tag instead (if you aren't wrapping the form around a model).

nfm
That worked great! thank you
Brian