Skip to content

Commit

Permalink
add birthdate in user/edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Gruhier committed May 18, 2012
1 parent e2a6536 commit b1cf77b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/assets/stylesheets/application.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ h1,h2,h3,h4,h5 {font-family: 'Convergence', sans-serif;}
margin-top: 0px;
color: #888;
}

select.date {
width: auto
}
.centered {
text-align:center
}
Expand Down Expand Up @@ -118,6 +120,7 @@ p.text {
padding:2px 5px;
margin-bottom: 5px
}

/* Filters */
.datepicker {
width: 100px;
Expand Down
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class User
include Mongoid::Document
include Mongoid::MultiParameterAttributes

# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= f.input :email, :required => true, :autofocus => true %>
<%= f.input :nickname, :input_html => {:autocomplete => :off} %>
<%#= f.input :birthdate, :as => :date %>
<%= f.input :birthdate, :as => :date, :start_year => Date.today.year - 120, :end_year => Date.today.year %>
<%= f.input :gender, :as => :radio_buttons, :collection => {"#{t :male}" => "male", "#{t :female}" => "female"} %>
<%= f.input :password, :input_html => {:autocomplete => :off}, :hint => t('devise.registrations.leave_blank'), :required => false %>
<%= f.input :password_confirmation, :required => false , :input_html => {:autocomplete => :off} %>
Expand Down

0 comments on commit b1cf77b

Please sign in to comment.