[英]rails 5 NoMethodError in RegistrationsController#new undefined method
Working on a course project and using rails 5 however the course isn't using rails 5 receiving this error after implementing this in NoMethodError in RegistrationsController#new undefined method `<<' for nil:NilClass处理课程项目并使用 rails 5 但是课程没有使用 rails 5 在 RegistrationsController#new undefined method `<<' for nil:NilClass 中的 NoMethodError 中实现后收到此错误
class RegistrationsController < ApplicationController
before_action :configure_permitted_paramters, if: :devise_controller?
protected
def configure_permitted_paramters
devise_parameter_sanitizer.permit(:sign_up) << :fullname
devise_parameter_sanitizer.permit(:account_update) << :fullname << :cell_number << :license_plate_number << :vehicle_description << :email << :password
end
end
My routes changed to this as well part of the problem?我的路线也变成了这个问题的一部分?
Rails.application.routes.draw do
root 'pages#home'
devise_for :users,
path => '',
:path_names => {:sign_in => 'login', :sign_out => 'logout', :edit => 'profile'},
controllers => {:omniauth_callbacks => 'omniauth_callbacks',
:registrations => 'registrations'
}
resources :users, only: [:show]
end
Your registration controller is redefining the Application Controller rather than defining the registration controller.您的注册控制器正在重新定义应用程序控制器,而不是定义注册控制器。 Try the following:
请尝试以下操作:
class RegistrationsController < ApplicationController
def new
end
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.