0
我使用Sinatra + rack-flash3寶石。我安裝了它,但儘管如此,它拋出了一個異常。這裏是一個layout.haml
Sinatra對寶石視而不見?
!!!5
%html
%body
.my_div
!= haml :"shared/_flash"
!= yield
和_flash.haml
.my-div2
.flash-notice
- if flash[:notice]
.alert.alert-success
= flash[:notice]
- if flash[:error]
.alert.alert-error
= flash[:error]
- if flash[:info]
.alert.alert-info
= flash[:info]
的誤差
undefined local variable or method `flash' for #<App:0x00000004226c90>
file: _flash.haml location: evaluate_source line: 3
我不知道爲什麼會出現這種情況?
我有同樣的問題,但不能得到這個工作。你剛剛說了什麼,但無濟於事。任何幫助,高度讚賞。 – AMBasra