Upgrading ERb tags for Rails 3 upgrade. Should I: <%= end %> as well?
-
12-11-2019 - |
Question
Given a block of rails 2.3.x ERb code:
<% form_for account, :url => { :action => :invite } do |f| %>
# blah
<% end %>
using the Rails upgrade plugin, it tells me that I need to replace <%
with <%=
should I also do this for the end
line? Such as:
<%= form_for account, :url => { :action => :invite } do |f| %>
# blah
<%= end %>
Solution
No, you would only need <%= when you start a block.
So it would be:
<%= form_for account, :url => { :action => :invite } do |f| %>
# blah
<% end %>
See this rails/asciicast for upgrading to the new erb.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow