无法删除闪光灯

Impossible to delete a flash

我在迁移插件之前犯了一个错误,写了

flash[:notice] = :label_presta_added

而不是

flash[:notice] = l(:label_presta_added)

我更正了我的错误,但我的 Redmine 插件似乎破坏了我的 Redmine。即使我再次删除我的插件迁移,我仍然收到此错误:

    Started GET "/" for 127.0.0.1 at 2016-06-01 22:21:37 +0200
Processing by WelcomeController#index as HTML
  Current user: admin (id=1)
  Rendered welcome/index.html.erb within layouts/base (28.1ms)
Completed 500 Internal Server Error in 366ms (ActiveRecord: 116.0ms)

ActionView::Template::Error (undefined method `html_safe' for :label_presta_added:Symbol
Did you mean?  html_safe?):
     97:     <div id="sidebar">
     98:         <%= yield :sidebar %>
     99:         <%= view_layouts_base_sidebar_hook_response %>
    100:     </div>
    101: 
    102:     <div id="content">
    103:         <%= render_flash_messages %>
  app/helpers/application_helper.rb:312:in `block in render_flash_messages'
  app/helpers/application_helper.rb:311:in `render_flash_messages'
  app/views/layouts/base.html.erb:100:in `_app_views_layouts_base_html_erb__4104276684161420982_39604440'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

有人可以帮我一下吗? 提前致谢!

你重启服务器了吗?或者您可以使用 flash[:notice] = nil 将其删除。

这存储在您的会话中,因此通常更改会话密钥会使所有会话失效并丢弃任何旧的会话数据。

您也可以尝试 rescue 一次性清除它。

它似乎引发了 html_safe 错误。你能看到渲染 flash 的方法是否使用 html_safe 吗?它看起来像是来自那里。

不确定,可能是在黑暗中拍摄。 但阅读这些并尝试可能是:

http://www.redmine.org/issues/8477