【发布时间】:2017-09-22 23:25:10
【问题描述】:
我尝试了以下方法,但它不起作用。它仍在使用默认的 Flash 消息。
class Users::SessionsController < Devise::SessionsController
after_action :custom_welcome, :only => [:create]
def custom_welcome
flash.notice = "Welcome back "+current_user.name+"." if flash.keys.include?(:notice)
end
end
参考:https://github.com/plataformatec/devise#configuring-controllers
【问题讨论】:
标签: ruby-on-rails devise ruby-on-rails-5 flash-message