0
引用Devise的在線文檔,但是我的覆蓋仍然不起作用。任何人都有什麼建議,爲什麼不呢?它只是在登錄後進入根目錄。註冊雖然有效。Rails 3:設計覆蓋sign_up控制器困境
路線:
root :to => 'pages#index'
get "pages/index"
devise_for :users, :path => 'accounts', :controllers => { :registrations => "registrations" }
match 'profile' => 'profiles#show', :as => 'current_profile'
match 'profile/edit' => 'profiles#edit', :as => 'edit_current_profile'
put 'profile' => 'profiles#update'
resources :users do
resources :profiles
end
登記控制器:
class RegistrationsController < Devise::RegistrationsController
protected
def after_sign_up_path_for(resource)
edit_current_profile_path
end
def after_sign_in_path_for(resource)
current_profile_path
end
end