Permalink
Browse files

#74 requerimiento implementado

  • Loading branch information...
Antonio Pardo
Antonio Pardo committed Mar 20, 2012
1 parent d3939db commit 423b761101ad4d92c478e3f569fe8f25e3caa688
Showing with 8 additions and 0 deletions.
  1. +4 −0 webapp/app/models/user.rb
  2. +4 −0 webapp/app/views/users/registrations/new.html.erb
@@ -19,12 +19,16 @@ class User
validates_uniqueness_of :username
validates_format_of :username, :with => /^([\w\.%\+\-]+)$/i
validates_acceptance_of :terms, :message => "Debes aceptar las condiciones de uso"
+ validates_presence_of :name
has_mongoid_attached_file :avatar,:styles => { :small => ['40x40', :png], :normal => ['80x80', :png] }, :default_url => "/assets/missing.png"
field :username, :type => String
field :biography, :type => String
+ field :name, :type => String
+ field :homepage, :type => String
+
## Database authenticatable
field :email, :type => String, :null => false, :default => ""
field :encrypted_password, :type => String, :null => false, :default => ""
@@ -3,11 +3,15 @@
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => "form-horizontal"}) do |f| %>
<legend>Registrarse</legend>
+ <%= f.text_field :name, :required => true %>
+
<%= f.text_field :username, :required => true, :maxlength => "20" do %>
<p class="help-block">Máximo 20 caracteres</p>
<% end %>
<%= f.email_field :email, :required => true %>
+
+ <%= f.text_field :homepage %>
<%= f.text_area :biography, :rows => 5 %>

0 comments on commit 423b761

Please sign in to comment.