开发者

Ruby on Rails remote_form_tag

开发者 https://www.devze.com 2023-01-20 03:41 出处:网络
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 %>

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 开发者_StackOverflowis?

Thank you


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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消