サインアップ時にユーザーを特定のページにリダイレクトできるように、RegistrationsController を作成することにしました。唯一の問題は、エラーが発生するため、ユーザーが作成されないことです。
Started POST "/users" for 127.0.0.1 at 2012-06-12 14:01:22 -0400
AbstractController::ActionNotFound (The action 'create' could not be found for R
egistrationsController):
私のルートとコントローラー:
devise_for :users, :controllers => { :registrations => "registrations" }
devise_scope :user do
get "/sign_up" => "devise/registrations#new"
get "/login" => "devise/sessions#new"
get "/log_out" => "devise/sessions#destroy"
get "/account_settings" => "devise/registrations#edit"
get "/forgot_password" => "devise/passwords#new", :as => :new_user_password
get 'users', :to => 'pages#home', :as => :user_root
end
class RegistrationsController < ApplicationController
protected
def after_sign_up_path_for(resource)
redirect_to start_path
end
def create # tried it with this but no luck.
end
end
何が起きてる?これはどのように修正されますか?
アップデート
create
アクションをの外側に置きましたprotected
が、今はMissing template registrations/create
. アクションを削除すると、 に戻りUnknown action: create
ます。