Skip to content

Commit

Permalink
Allowing emails to be edited
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaberer committed Jul 8, 2013
1 parent de0d317 commit 8b60d69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -8,7 +8,7 @@ class User < ActiveRecord::Base

# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :username,
:email_reminder
:email_reminder, :time_zone

validates :username, :presence => { :message => 'You need to pick a username' }

Expand Down
24 changes: 5 additions & 19 deletions app/views/devise/registrations/edit.html.haml
Expand Up @@ -4,32 +4,18 @@
:as => resource_name,
:url => registration_path(resource_name),
:html => { :method => :put, :class => 'form-horizontal' }) do |f|
= f.text_field :email
= f.password_field :password
= f.password_field :password_confirmation
= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones
%p
%p.offset2
%strong If you want, we can send you a nightly reminder to post.
.control-group
.controls
= f.label :email_reminder do
= f.check_box :email_reminder
Send me an email to remind me.
%p
%p.offset2
%strong We need your current password, if you're making any changes.
.field
= f.password_field :current_password, :placeholder => 'Current Password'
.control-group
.controls
= f.submit "Update"

.cancel
%h3 Cancel my account

%p
= link_to "Cancel my account",
registration_path(resource_name),
:confirm => "Are you sure? Once you do this, there is no going back!",
:class => 'btn btn-danger',
:method => :delete
%br.clear

= f.password_field :current_password, :placeholder => 'Current Password'
= f.submit "Update"

0 comments on commit 8b60d69

Please sign in to comment.