相关疑难解决方法(0)

无法登录用户资源 - 设计/ sessionsController #create中的NoMethod错误

我对Rails 3和Devise有一个特殊的问题.我的Rails应用程序有3种用户类型:
客户端,所有者和管理员

routes.rb中:

   devise_for :admins
   devise_for :owners
   devise_for :clients 
Run Code Online (Sandbox Code Playgroud)

application_controller.rb:

def after_sign_in_path_for(resource)
    if resource == "client"
        "/client_accounts/" + current_client.id.to_s
    elsif resource == "admin"
        stored_location_for(:admins) || "/admin/control_panel"
    elsif resource == "owner" 
        stored_location_for(:owners) || "/client_accounts"
    end
end
Run Code Online (Sandbox Code Playgroud)

我的登录所有者和管理员工作正常,但我无法让客户登录工作..这是我得到的错误:

NoMethodError in Devise/sessionsController#create
undefined method `client_url' for #<Devise::SessionsController:0x10a98f868>
Run Code Online (Sandbox Code Playgroud)

应用程序跟踪为空.

ruby ruby-on-rails devise

4
推荐指数
1
解决办法
1622
查看次数

标签 统计

devise ×1

ruby ×1

ruby-on-rails ×1