我想在我的应用程序中添加使用 JSON 格式和其他一些特定内容注册的选项。我尝试添加自己的RegistrationsController
控制器,然后将路线设置为如下所示:
devise_for :users, :path_names => { :sign_in => 'signin', :sign_out => 'signout', :sign_up => 'signup' }
match 'signin', :to => 'devise/sessions#new', :as => "new_user_session"
match 'signout', :to => 'devise/sessions#destroy', :as => "destroy_user_session"
match 'signup(.:format)', :to => 'registrations#new', :as => "new_user_registration"
我RegistrationsController
在 app/controllers/registrations_controller.rb 中看起来像这样:
class RegistrationsController < Devise::RegistrationsController
prepend_view_path "app/views/devise"
def create
# My custom implementation
end
end
无论格式如何,它总是抛出以下错误
AbstractController::ActionNotFound (AbstractController::ActionNotFound):
/usr/local/Cellar/Gems/1.8/gems/devise-1.1.rc2/lib/devise/controllers/internal_helpers.rb:57:in `is_devise_resource?'
...
我什至尝试将注册控制器从 git 添加到 app/controllers/devise/registrations_controller.rb 并更改路由以指向那个,但这也不起作用。有人有想法吗?