Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:58:21+00:00 2026-06-02T23:58:21+00:00

I want to setup a ‘Create Account’ page. The gems I’m using are: rails

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:58:23+00:00Added an answer on June 2, 2026 at 11:58 pm

    I’m in a similar situation where simple_form does validate a field in another model, but not in the user model.

    In any case, I noticed you don’t have:

    validates_presence_of :password
    

    in your model. Maybe mongoid saves you from doing that step? I don’t know mongoid, but for me that is the magic that validates that the field is not blank. For the field that is working for me I have this:

    validates_presence_of :title, :localeLanguage, :message => "can't be blank"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to setup a serialized task queue using NSOperationQueue but I'm a little
I want to setup a route so that if the user goes to http://mysite.com/page.html
When using routing (asp.net webforms) I want to setup a home route so I
I want to setup a Win7 virtual machine to develop using Visual Studio 2008
I want to setup a simple shopping cart using PHP, only 2 items, I
I want to setup a WPF Application. But instead of using the entry point
I want to setup a cron job that logs in to my facebook account,
I want to setup a JSP page to: to call DDR server with address:
I want to setup a sync service using Microsoft Sync Framework. The main objective
I want to setup different rails versions with RVM. However, working with the SQLite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.