diff options
| -rw-r--r-- | app/models/user.rb | 2 | ||||
| -rw-r--r-- | app/views/registrations/edit.html.erb | 8 | ||||
| -rw-r--r-- | db/migrate/20120522060801_add_details_to_users.rb | 6 | ||||
| -rw-r--r-- | db/schema.rb | 4 |
4 files changed, 18 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 1cf4c8d1..33a9e8a1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,7 @@ class User < ActiveRecord::Base validates :name, :presence => true has_many :authentications devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable - attr_accessible :name, :email, :website, :password, :password_confirmation, :remember_me + attr_accessible :name, :email, :website, :twitter, :facebook, :password, :password_confirmation, :remember_me has_many :creations, :dependent => :destroy has_many :favorites, :dependent => :destroy diff --git a/app/views/registrations/edit.html.erb b/app/views/registrations/edit.html.erb index c76ab961..9749954d 100644 --- a/app/views/registrations/edit.html.erb +++ b/app/views/registrations/edit.html.erb @@ -46,6 +46,14 @@ <%= f.label :website, :class => "control-label" %> <div class="controls"> <%= f.url_field :website, :class => "input-xlarge, url", :placeholder => "http://cakeside.com" %> </div> </div><!-- /control-group --> + <div class="control-group"> + <%= f.label :twitter, :class => "control-label" %> + <div class="controls"> <%= f.text_field :twitter, :class => "input-xlarge", :placeholder => "@CakeSide" %> </div> + </div><!-- /control-group --> + <div class="control-group"> + <%= f.label :facebook, :class => "control-label" %> + <div class="controls"> <%= f.text_field :facebook, :class => "input-xlarge", :placeholder => "http://www.facebook.com/your_profile" %> </div> + </div><!-- /control-group --> <div class="form-actions"> <input type="submit" class="btn btn-primary" value="Save changes" /> <button type="reset" class="btn">Cancel</button> diff --git a/db/migrate/20120522060801_add_details_to_users.rb b/db/migrate/20120522060801_add_details_to_users.rb new file mode 100644 index 00000000..aef9de42 --- /dev/null +++ b/db/migrate/20120522060801_add_details_to_users.rb @@ -0,0 +1,6 @@ +class AddDetailsToUsers < ActiveRecord::Migration + def change + add_column :users, :twitter, :string + add_column :users, :facebook, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 9a6283b2..413fe781 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120517125545) do +ActiveRecord::Schema.define(:version => 20120522060801) do create_table "active_admin_comments", :force => true do |t| t.integer "resource_id", :null => false @@ -96,6 +96,8 @@ ActiveRecord::Schema.define(:version => 20120517125545) do t.datetime "updated_at", :null => false t.string "name" t.string "website" + t.string "twitter" + t.string "facebook" end add_index "users", ["email"], :name => "index_users_on_email", :unique => true |
