Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HAML - style block helpers are deprecated

Tags:

haml

I have the following view that used to render without any warnings:

#listing
-if flash[:notice]
  .success
    =flash[:notice]
.input-container
-form_for @user do |f|
  =f.error_messages
  =render :partial => 'form', :locals => {:f => f}

But now when I render the view by running a functional test, I get the following warning:

DEPRECATION WARNING: - style block helpers are deprecated. Please use =.

Does anyone know what this warning means?

like image 559
dagda1 Avatar asked Mar 06 '11 16:03

dagda1


1 Answers

Yeah, instead of:

-form_for @user do |f|

use

=form_for @user do |f|

In other words, do exactly what it suggests. Flip the dash into an equals. This is new in Rails 3.

http://edgeguides.rubyonrails.org/3_0_release_notes.html#action-view (Section 7.4.2)

like image 191
Josh Deeden Avatar answered Nov 05 '22 21:11

Josh Deeden