Ruby on rails 设计新的行动
我正试图在我的Desive注册控制器中添加一个新操作,但未找到错误路由。我以前没有这样做,因此可能犯了错误。我正在注册控制器上添加索引操作。我使用Desive创建了一个用户模型。getting errorNo route matches[GET]“/users/registrations”Ruby on rails 设计新的行动,ruby-on-rails,devise,Ruby On Rails,Devise,我正试图在我的Desive注册控制器中添加一个新操作,但未找到错误路由。我以前没有这样做,因此可能犯了错误。我正在注册控制器上添加索引操作。我使用Desive创建了一个用户模型。getting errorNo route matches[GET]“/users/registrations” [注册/控制器] 您是否更改了应用程序布局??不,我必须做哪些更改?您是否使用任何自定义布局?不,我没有使用任何自定义布局粘贴您的html代码以获得更多说明 class Users::Registratio
[注册/控制器]
您是否更改了应用程序布局??不,我必须做哪些更改?您是否使用任何自定义布局?不,我没有使用任何自定义布局粘贴您的html代码以获得更多说明
class Users::RegistrationsController < Devise::RegistrationsController
# before_filter :configure_sign_up_params, only: [:create]
# before_filter :configure_account_update_params, only: [:update]
# GET /resource
def index
@users=User.all
redirect_to index_path
end
# GET /resource/sign_up
# def new
# super
# end
# POST /resource
# def create
# super
# end
# GET /resource/edit
# def edit
# super
# end
# PUT /resource
# def update
# super
# end
# DELETE /resource
# def destroy
# super
# end
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
# def cancel
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_up_params
# devise_parameter_sanitizer.for(:sign_up).permit(:attachment)
# end
# If you have extra params to permit, append them to the sanitizer.
# def configure_account_update_params
# devise_parameter_sanitizer.for(:account_update) << :attribute
# end
# The path used after sign up.
# def after_sign_up_path_for(resource)
# super(resource)
# end
# The path used after sign up for inactive accounts.
# def after_inactive_sign_up_path_for(resource)
# super(resource)
# end
end
devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations'
#get 'users/registrations'
}
devise_scope :user do
get 'registrations/index', :action => 'index', :controller => 'registrations'
end