2

I using devise gem for registration but i have problem. my table include: first_name, last_name, email.... but when click http://localhost:3000/users/sign_up. it only show email, password. please see image here

I need all show field first_name, last_name... please help me. thanks

create_table(:users) do |t|
      t.string :first_name
      t.string :last_name
      t.database_authenticatable :null => false
      t.recoverable
      t.rememberable
      t.trackable
      t.invitable
      t.references :address
      t.integer :current_city_id
      t.integer :hometown_id
      t.string :university
      t.integer :grad_year
      t.string :degree
      # t.confirmable
      # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
      # t.token_authenticatable


      t.timestamps
    end

1 Answer 1

5

You need to generate devise views with this command

rails generate devise:views

Than find registrations/new.html.erb view and add to it fields that you want.

 <p><%= f.label :first_name %><br />
  <%= f.password_field :first_name %></p>
 <p><%= f.label :last_name %><br />
  <%= f.password_field :last_name %></p>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.