請幫忙!紅寶石Rails4和設計
我是一個紅寶石的初學者在鐵軌上。
我正在更新從簡單的web表單到sqlite3數據庫的值。
問題只是電子郵件&密碼字段被插入到表中。名字,姓氏等顯示值'無'
我使用DEVISE進行身份驗證設置。
這裏是我的user.rb代碼:從我的web表單
<div><%= f.label :first_name %><br />
<%= f.text_field :first_name %></div>
<div><%= f.label :last_name %><br />
<%= f.text_field :last_name %></div>
<div><%= f.label :profile_name %><br />
<%= f.text_field :profile_name %></div>
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me,
:first_name, :last_name, :profile_name
end
代碼,並從我的遷移文件夾中的代碼摘錄:
def changed
create_table(:users) do |t|
t.string :first_name
t.string :last_name
t.string :profile_name
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
請幫助!
感謝您的信息豐富!我知道你引用的命令。但是,是的,我需要看github頁面的設計進行改進。非常感謝!! 祝您好運! 幫我在未來:) – user2878191