When upgrading from Rails 3.0 to 3.1, one of the common issues we face is the breaking change in ERB syntax for helper methods. This change impacts form_tag
, form_for
, content_tag
, javascript_tag
, fields_for
, and field_set_tag
.
The main issue is that these helper methods in Rails 3.1 now require the use of <%= %>
to output content, whereas in Rails 3.0 (and earlier), they used <% %>
without needing to explicitly output the form content. This change is not backward-compatible, and applying it across a large codebase can be quite tedious when we are using our method of dual booting an application to do an upgrade.
In this article we will explore a few possibilities we have uncovered in the past few years while doing these upgrades.
Read more