开发者

Ruby on Rails remote_form_tag

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜