Ruby on rails 如何重定向到炼油厂仪表板页面而不是应用程序根页面

Ruby on rails 如何重定向到炼油厂仪表板页面而不是应用程序根页面,ruby-on-rails,ruby-on-rails-3.2,refinerycms,Ruby On Rails,Ruby On Rails 3.2,Refinerycms,我有一个rails 3.2.8应用程序,它使用Desive 2.0.0进行身份验证,我将refinerycms与此应用程序集成在一起,现在它成功集成了,问题是当用户点击 localhost/refinery我需要进入refinery登录页面,但之后 成功登录它会重定向回我的应用程序主页,而不是 而不是DefineryCMS仪表板页面 所以我想知道如何重定向到 炼油厂成功登录程序后的炼油厂仪表板。 我有路线装载精炼厂::核心::引擎 :at => '/' root to:'projects#

我有一个rails 3.2.8应用程序,它使用Desive 2.0.0进行身份验证,我将refinerycms与此应用程序集成在一起,现在它成功集成了,问题是当用户点击

localhost/refinery
我需要进入refinery登录页面,但之后 成功登录它会重定向回我的应用程序主页,而不是 而不是DefineryCMS仪表板页面

所以我想知道如何重定向到 炼油厂成功登录程序后的炼油厂仪表板。 我有路线装载
精炼厂::核心::引擎

:at => '/' root to:'projects#index'

etc

创建自定义设备控制器,在用户登录后将其重定向到您想要的位置:

创建自定义控制器:controllers/users/sessions\u Controller.rb

  class Users::SessionsController < Devise::SessionsController

  before_filter :authenticate_user!, :only => [:destroy] 

  def new 
    super
  end

  def create
      #Can edit this for custom redirect
      super
  end

  def destroy
    super
  end

  protected

  def stub_options(resource)
     methods = resource_class.authentication_keys.dup
     methods = methods.keys if methods.is_a?(Hash)
     methods << :password if resource.respond_to?(:password)
     { :methods => methods, :only => [:password] }
  end

  def after_sign_in_path_for(resource)
      #Can edit this for custom redirect
      super
  end

  def after_sign_out_path_for(resource)
    super
  end

  private

end
devise_for :users, :controllers => {:sessions => "users/sessions"}