1
我遵循這個設計how to: Redirect to a specific page on successful sign up。重寫設計註冊後無法刪除資源控制器
我創建了一個新的RegistrationsController
class RegistrationsController < Devise::RegistrationsController
def after_inactive_sign_up_path_for(resource)
...
end
def destroy
logger.debug 'destroy user'
...
end
end
我已經改變了的routes.rb:
devise_for :users, :controllers => { :registrations => "registrations" } do
get 'users', :to => 'profile#index', :as => :user_root
end
,並在我的新RegistrationsController移動devise/registrations/
意見。
隨着rake routes
我:
DELETE /users(.:format) {:action=>"destroy", :controller=>"registrations"}
after_inactive_sign_up_path_for
工作。
但destroy
動作不工作:當我取消我的帳戶
<%= button_to "Cancel my account", registration_path(resource_name), :confirm => "ok?", :method => :delete %>
我有以下錯誤:
The action 'destroy' could not be found for RegistrationsController
我用設計1.4.5 &的Rails 3.1