Rails 3 Block Helpers Deprecation Warning

January 4th, 2011

When I run rake test for a Rails 3 application I am developing, I receive a deprecation warning about block helpers:

.DEPRECATION WARNING: <% %> style block helpers are deprecated. Please use <%= %>.

Hmmm. When I try to do so, Vim gives me an error, because I have it setup to parse eruby files. If I save the file anyway and run rake test again, the tests run fine, and no deprecation warning about block helpers is issued.

I also confirmed the code works OK when running rails server -p 3001, the latter part of that command instructing the web server to run on port 3001.

The final result is:

<%= form_for([:child_support, payment]) do |f| -%>
  <input type="text" name="payment[payment_date]"/>
  <input type="text" name="payment[amount]"/>
    <%= f.submit %>
<% end -%>
Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022