Flash Messages in Partials (Rails 3)

后端 未结 4 731
孤街浪徒
孤街浪徒 2020-12-28 15:13

I have a partial, _flash.html.haml

- flash.each do |type, value|
  .flash{ :class => type.to_s }
    = value 

Which I\'m re

4条回答
  •  心在旅途
    2020-12-28 15:32

    Because your partial is named "_flash", you should have the :object local to specify variable flash inside the partial.

    Change your partial name and you will be able to use flash inside, for example:

    = render "show_flash_names"
    

提交回复
热议问题