i am trying to add the fields 'first name', 'last name' and 'phone'. However, i always get this error when revisiting local host:
NoMethodError in Devise::RegistrationsController#new
undefined method `configure_permitted_parameters' for #<Devise::RegistrationsController:0x00000101fcd008>
This is what i did:
first, i created a registrations controller:
class RegistrationsController < Devise::RegistrationsController
before_filter :configure_permitted_parameters, :only => [:create]
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :phone, :email, :password, :password_confirmation) }
end
end
then, i ran:
rails g migration AddFieldsToUsers first_name:string last_name:string phone:int
followed by:
rake db:migrate
in the terminal...
i then went and added
t.string :first_name,
t.string :last_name,
t.integer :phone,
in the devise create users migration file.
i also tried replacing add_column to t.string in my AddFieldsToUsers migration file:
class AddFieldsToUsers < ActiveRecord::Migration
def change
t.string :users, :first_name, :string
t.string :users, :last_name, :string
t.integer :users, :phone, :int
end
end
I would really appreciate it if someone could help figure this out thank you.