2011-06-11 106 views
2

我使用设计宝石注册,但我有问题。我的表格包括:名字,姓氏,电子邮件....但点击http://localhost:3000/users/sign_up。它只显示电子邮件,密码。 please see image here设计注册问题

我需要所有显示字段first_name,last_name ...请帮助我。感谢

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 

回答

5

你需要生成与此命令

rails generate devise:views 

比找到registrations/new.html.erb视图,并加入到IT领域,你要设计的看法。

<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

感谢您的支持 – khanh 2011-06-11 06:59:31