Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Rails3 ActionView erroneous deprecation warnings

#5868

DEPRECATION WARNING: <% %> style block helpers are deprecated. Please use <%= %>. (called from app_views_customs_shipment_pars_checks_new_html_erb__256117305_23535140524620_0 at ./app/views/customs_shipment_pars_checks/new.html.erb:8)

code:

 8  <%- content_tag :h2, :header do -%>
 9    <%=h(yield(:page_title))-%>
10  <%- end -%>

The deprecation warning with its recommendation to change the code to <%= is decidedly wrong. Doing so leads immediately to a syntax error. I am not sure what this message is meant to accomplish.

Reported by James B. Byrne · October 26th, 2010 @ 05:29 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Denis Odorcic
    Denis Odorcic

    Setting

    <%- content_tag :h2, :header do -%>
    
    to
    <%= content_tag :h2, :header do -%>
    
    works fine for me. Make sure not to include an <%= on the <% end %>

    October 26th, 2010 @ 11:11 PM

  2. James B. Byrne
    James B. Byrne

    You are right. I must have added the = to the end statement as well.

    October 27th, 2010 @ 04:09 PM

  3. Aditya Sanghi
    Aditya Sanghi
    • State changed from new to invalid
    • Importance changed from to Low

    If the error was not the one mentioned in the above comment, kindly comment to re-open ticket.

    October 28th, 2010 @ 07:44 AM