Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Install devise, add a user, install devise views

  • Loading branch information...
commit 444b66d6167fc5f9bc42009a9052c215da07f8a7 1 parent 424fa38
arpit authored April 08, 2013
3  app/models/user.rb
@@ -6,6 +6,7 @@ class User < ActiveRecord::Base
6 6
          :recoverable, :rememberable, :trackable, :validatable
7 7
 
8 8
   # Setup accessible (or protected) attributes for your model
9  
-  attr_accessible :email, :password, :password_confirmation, :remember_me
  9
+  attr_accessible :email, :password, :password_confirmation, :remember_me,
  10
+  					:first_name, :last_name, :profile_name
10 11
   # attr_accessible :title, :body
11 12
 end
17  app/views/devise/registrations/new.html.erb
... ...
@@ -1,8 +1,23 @@
1  
-<h2>Sign up</h2>
  1
+ <h2>Sign up</h2>
2 2
 
3 3
 <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4 4
   <%= devise_error_messages! %>
5 5
 
  6
+<div> <%= f.label :first_name %> <br>
  7
+		<%= f.text_field :first_name %>
  8
+</div>
  9
+
  10
+
  11
+<div> <%= f.label :last_name %> <br>
  12
+		<%= f.text_field :last_name %>
  13
+</div>
  14
+	
  15
+
  16
+<div> <%= f.label :profile_name %> <br>
  17
+		<%= f.text_field :profile_name %> 
  18
+</div>
  19
+
  20
+
6 21
   <div><%= f.label :email %><br />
7 22
   <%= f.email_field :email, :autofocus => true %></div>
8 23
 
7  db/migrate/20130408133745_add_user_id_to_statuses.rb
... ...
@@ -0,0 +1,7 @@
  1
+class AddUserIdToStatuses < ActiveRecord::Migration
  2
+  def change
  3
+  	add_column :statuses, :user_id, :integer
  4
+  	add_index :statuses, :user_id
  5
+  	remove_column :statuses, :name
  6
+  end
  7
+end
6  db/schema.rb
@@ -11,15 +11,17 @@
11 11
 #
12 12
 # It's strongly recommended to check this file into your version control system.
13 13
 
14  
-ActiveRecord::Schema.define(:version => 20130407123935) do
  14
+ActiveRecord::Schema.define(:version => 20130408133745) do
15 15
 
16 16
   create_table "statuses", :force => true do |t|
17  
-    t.string   "name"
18 17
     t.text     "content"
19 18
     t.datetime "created_at", :null => false
20 19
     t.datetime "updated_at", :null => false
  20
+    t.integer  "user_id"
21 21
   end
22 22
 
  23
+  add_index "statuses", ["user_id"], :name => "index_statuses_on_user_id"
  24
+
23 25
   create_table "users", :force => true do |t|
24 26
     t.string   "first_name"
25 27
     t.string   "last_name"

0 notes on commit 444b66d

Please sign in to comment.
Something went wrong with that request. Please try again.