2016-03-30 114 views
0

我想更改消息「您需要先登錄或註冊才能繼續。」當我從活動管理面板註銷時。我在devise.en.yml中更改了消息,但我只想更改註銷。更改默認登錄消息

+0

定義定製所需信息的新翻譯變量的缺省值更改閃光燈消息。用新變量更新註銷消息。 – Bijendra

回答

1

當我想從我通常把它在控制器

# app/admin/devise/sessions.rb 
class ActiveAdmin::Devise::SessionsController 

    # POST /resource/sign_in 
    def create 
    self.resource = warden.authenticate!(auth_options) 
    #set_flash_message!(:notice, :signed_in) 
    flash[:alert] = 'New message here' 
    sign_in(resource_name, resource) 
    yield resource if block_given? 
    respond_with resource, location: after_sign_in_path_for(resource) 
    end 
end