Skip to content

Commit

Permalink
added field name in register form
Browse files Browse the repository at this point in the history
  • Loading branch information
devton committed Mar 28, 2012
1 parent 8e0797b commit ba7039b
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 307 deletions.
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class User < ActiveRecord::Base
validates_uniqueness_of :uid, :scope => :provider
validates_length_of :bio, :maximum => 140
validates :email, :email => true, :allow_nil => true, :allow_blank => true
validates :name, :presence => true, :if => :is_devise?

validates_presence_of :email, :if => :is_devise?
validates_uniqueness_of :email, :scope => :provider, :if => :is_devise?
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/_login.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
= label_tag 'remember_meber_me', t('.remember_me'), :class => 'inline'
#new_email_account{:class=>"#{(params[:show_new_user].present? ? "" : "hide")}"}
= form_for(User.new, :as => :user, :url => registration_path(:user), :html => {:class => 'login_with_email_form'}) do |f|
%p.input
= f.label :name
= f.text_field :name
%p.input
= f.label :email
= f.text_field :email
Expand Down
Loading

0 comments on commit ba7039b

Please sign in to comment.