Skip to content

Commit 3ca954c

Browse files
committed
added language field in User sign-up
1 parent 570daff commit 3ca954c

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
22

33
gem 'rails', '3.0.5'
44
gem 'devise'
5-
gem 'mysql2'
5+
gem 'mysql'
66
gem 'acts-as-taggable-on'
77
gem 'RedCloth', :require => 'redcloth'
88
gem 'haml'

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ GEM
5252
mime-types (~> 1.16)
5353
treetop (~> 1.4.8)
5454
mime-types (1.16)
55-
mysql2 (0.2.7)
55+
mysql (2.8.1)
5656
orm_adapter (0.0.4)
5757
polyglot (0.3.1)
5858
rack (1.2.2)
@@ -107,7 +107,7 @@ DEPENDENCIES
107107
haml
108108
hpricot
109109
jquery-rails
110-
mysql2
110+
mysql
111111
rails (= 3.0.5)
112112
rspec-rails
113113
ruby_parser

app/views/devise/registrations/new.html.haml

+3
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
= f.label :password_confirmation
2727
%br/
2828
= f.password_field :password_confirmation
29+
%p
30+
= f.label :language
31+
%br= f.select :language, User.languages.invert
2932
%p= f.submit I18n.t('user.sign_up')
3033

db/schema.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended to check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(:version => 20110417042516) do
13+
ActiveRecord::Schema.define(:version => 20110619143728) do
1414

1515
create_table "notes", :force => true do |t|
1616
t.text "text"
@@ -50,8 +50,8 @@
5050
end
5151

5252
create_table "users", :force => true do |t|
53-
t.string "email", :default => "", :null => false
54-
t.string "encrypted_password", :limit => 128, :default => "", :null => false
53+
t.string "email", :default => "", :null => false
54+
t.string "encrypted_password", :limit => 128, :default => "", :null => false
5555
t.string "reset_password_token"
5656
t.datetime "remember_created_at"
5757
t.integer "sign_in_count", :default => 0
@@ -62,7 +62,8 @@
6262
t.datetime "created_at"
6363
t.datetime "updated_at"
6464
t.string "password_salt"
65-
t.string "username", :default => "Anônimo"
65+
t.string "username"
66+
t.string "language"
6667
end
6768

6869
add_index "users", ["email"], :name => "index_users_on_email", :unique => true

db/seeds.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#
66
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
77
# Mayor.create(:name => 'Daley', :city => cities.first)
8-
User.create(:email => 'demo@snote.com', :password => 'snote11', :password_confirmation => 'snote11')
8+
User.create(:username => 'demo', :email => 'demo@snote.com', :password => 'snote11', :password_confirmation => 'snote11')
99

0 commit comments

Comments
 (0)