Very new to working with rails. I have implemented a basic login system using Devise. I am trying to add a couple of new fields (bio:string, name:string) into the sign_up pa
I was having trouble with this too. The documentation on devise's site helped as well as some forums. Here's what I ended up doing:
In custom RegistrationsController (app/controllers/users/registrations_controller.rb)
# app/controllers/users/registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController
before_filter :update_sanitized_params, if: :devise_controller?
def update_sanitized_params
devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :password, :password_confirmation)}
end
end
Then in your route file (config/routes.rb) us this for your devise_for statement:
devise_for :users, controllers: {registrations: "users/registrations"}