开发者

HAML - style block helpers are deprecated

开发者 https://www.devze.com 2023-02-15 07:10 出处:网络
I have the following view that used to render without any warnings: #listing -if flash[:notice] .success

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_mes开发者_JS百科sages
  =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?


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消