SHARE
TWEET

HAML registration form

a guest Oct 26th, 2012 43 Never
  1. %h1 Registration
  2.  
  3. = form_tag '/doregister' do
  4.   -if @user.errors.any?
  5.     .error_message
  6.       %h2 Please correct the issues below:
  7.       %ul
  8.         -@user.errors.each do |attribute, message|
  9.           -next if attribute == :password_digest
  10.           %li= @user.errors.full_message(attribute, message)
  11.  
  12.   = label :user, :name, 'Choose your username'
  13.   = text_field :user, :name, :size => 50, :maxlength => 20, :autofocus => true
  14.   .hint Only alphanumeric characters and underscore
  15.  
  16.   = label :user, :password, 'Choose a password'
  17.   = password_field :user, :password, :size => 50, :maxlength => 20
  18.   .hint 4 or more characters
  19.  
  20.   = label :user, :password_confirmation, 'Confirm the password'
  21.   = password_field :user, :password_confirmation, :size => 50, :maxlength => 20
  22.  
  23.   = label :user, :email, 'Your email address'
  24.   = email_field :user, :email, :size => 50
  25.  
  26.   = submit_tag 'Register'
RAW Paste Data
Top