useranon
useranon

Reputation: 29514

Difference between <%= form_tag and <% form_tag

I am having a problem in Rails .. I might be a silly question, but pls give me suggestions.

What is the difference between:

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

and:

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

Please give me some suggestions.

Upvotes: 3

Views: 1797

Answers (1)

Simone Carletti
Simone Carletti

Reputation: 176382

They do the same thing. The former is the Rails 3 syntax, the latter targets Rails versions < 3.

Rails 3 still support the syntax without the leading equal but it currently prints a deprecation warning. The Rails 2 syntax will be removed in Rails 3.1.

Upvotes: 10

Related Questions