I want to setup a 'Create Account' page. The gems I'm using are:
- rails (3.2.3)
- simple_form (2.0.1)
- omniauth-identity
- twitter-bootstrap-rails (2.0.6)
- mongoid (2.2.3)
The form looks as follows:
= simple_form_for @identity, :url => '/auth/identity/register', :html => { :class => 'form-horizontal' } do |f|
= f.input :name, :input_html => {:name => 'name'}
= f.input :email, :input_html => {:name => 'email'}
= f.input :password, :as => 'password', :input_html => {:name => 'password'}
= f.input :password_confirmation, :label => "Confirm Password", :as => 'password', :input_html => {:name => 'password_confirmation'}
.form-actions
= f.button :submit, 'Sign Up', class: 'btn-primary'
= link_to 'Cancel', root_path, class: 'btn-danger'
The corresponding Identity model is
class Identity
include Mongoid::Document
include OmniAuth::Identity::Models::Mongoid
field :name, :type => String
field :email, :type => String
field :password_digest, :type => String
validates_presence_of :name, :email
validates_uniqueness_of :email
validates_format_of :email, :with => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i
end
If I don't fill in any of the text field of the form and then click on 'Sign Up', the form does not display any error messages from the validators, but instead redirects me to the home page!
Am I missing something obvious or could this be some problem with the gem versions I am using? I could of course implement the same form without simple_form using twitter-bootstrap markup, but would prefer it this way.