我遇到了Rails 3和Devise的一个特殊问题。我有我的Rails应用程序3的用户类型:
客户,业主和管理员无法登录用户资源 - 设计/会话控制器中的NoMethod错误#创建
的routes.rb:
devise_for :admins
devise_for :owners
devise_for :clients
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
我登录的为业主和管理员工作正常,但我无法让客户登录工作..这是我得到的错误:
NoMethodError in Devise/sessionsController#create
undefined method `client_url' for #<Devise::SessionsController:0x10a98f868>
应用程序跟踪为空。
现在,这就是我所说的SWEEEEETTT !!! :) – 2011-04-27 20:05:43
真实的故事伴侣,甜蜜。就像他说的^^ – 2011-12-23 22:23:42