The difference between <% = form_tag and <% form_tag

I have a problem with Rails. I may be a dumb question, but pls give me suggestions.

What's the difference between:

  <%= form_tag("path", :method=>'post') do %>
  <% end %>

and

  <% form_tag("path", :method=>'post') do %>
  <% end %>

Please give me some advice.

+3
source share
1 answer

They do the same thing. The first is Rails 3 syntax, the last is Rails version <3.

Rails 3 still supports syntax without a leading level, but is currently printing an obsolescence warning. The Rails 2 syntax will be removed in Rails 3.1.

+10
source

All Articles