diff options
| author | mo k <mo@mokhan.ca> | 2012-05-17 06:58:47 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-05-17 06:58:47 -0600 |
| commit | a72eae9ec401a6fbf0675d681858ea3fdfee40e7 (patch) | |
| tree | b17292384572bd248e0b636bec5a6e0de849fc1e | |
| parent | 224be5744f3929658fd3da0e85e9affc4b21b34c (diff) | |
add website property to the User model and create migration.
| -rw-r--r-- | app/controllers/registrations_controller.rb | 5 | ||||
| -rw-r--r-- | app/models/user.rb | 2 | ||||
| -rw-r--r-- | app/views/registrations/edit.html.erb | 2 | ||||
| -rw-r--r-- | db/migrate/20120517125545_add_website_to_users.rb | 5 | ||||
| -rw-r--r-- | db/schema.rb | 3 |
5 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 8eed79dd..d50fbe46 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,6 +3,11 @@ class RegistrationsController < Devise::RegistrationsController super session[:omniauth] = nil unless @user.new_record? end + + #def update + #logger.log(params) + #super + #end private diff --git a/app/models/user.rb b/app/models/user.rb index 11fb3ac8..1cf4c8d1 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, :password, :password_confirmation, :remember_me + attr_accessible :name, :email, :website, :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 0638c515..9e1cff65 100644 --- a/app/views/registrations/edit.html.erb +++ b/app/views/registrations/edit.html.erb @@ -37,7 +37,7 @@ </div><!-- /control-group --> <div class="control-group"> <%= f.label :website, :class => "control-label" %> - <div class="controls"> <%= f.password_field :website, :class => "input-xlarge" %> </div> + <div class="controls"> <%= f.text_field :website, :class => "input-xlarge" %> </div> </div><!-- /control-group --> <div class="form-actions"> <input type="submit" class="btn btn-primary" value="Save changes" /> diff --git a/db/migrate/20120517125545_add_website_to_users.rb b/db/migrate/20120517125545_add_website_to_users.rb new file mode 100644 index 00000000..8687ceca --- /dev/null +++ b/db/migrate/20120517125545_add_website_to_users.rb @@ -0,0 +1,5 @@ +class AddWebsiteToUsers < ActiveRecord::Migration + def change + add_column :users, :website, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 04386c23..9a6283b2 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 => 20120301034745) do +ActiveRecord::Schema.define(:version => 20120517125545) do create_table "active_admin_comments", :force => true do |t| t.integer "resource_id", :null => false @@ -95,6 +95,7 @@ ActiveRecord::Schema.define(:version => 20120301034745) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "name" + t.string "website" end add_index "users", ["email"], :name => "index_users_on_email", :unique => true |
