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 7530619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:57:38+00:00 2026-05-30T04:57:38+00:00

my ruby on rails 3.0.3 app display an empty address form when showing the

  • 0

my ruby on rails 3.0.3 app display an empty address form when showing the cart to a customer.

The addresse module ask the presence of all fields :

validates :nom,:prenom,:adresse,:code_postal,:ville,:email, :presence => true

If I validate an empty form it works despite validate condition.
I complete the forms, go to next page and comes back to the now populated creation form. Now if i remove a field the valiates is taken into account.

Here is my empty address creation code for the nested form in the show action :

if (@cartshowed.adresse_client.nil?)
        @cartshowed.build_adresse_client
      end

I guess that when usind the empty address validation is ignored, but as soon as i validate data for an already valid adress it works.

How can i have validation working when i create the address, and not only for edition ?

PS : The edition/creation is done on the same page through the same controllers. Edition was not intended to exist but it works.

EDIT : After several try i think my problem is that creating adresse through nested forms completly overiddes validates field in address.
How can i kee validates restriction in a nested form?

  • 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-05-30T04:57:39+00:00Added an answer on May 30, 2026 at 4:57 am

    It seems that as soon as i use reject_if the validation of my children model is not totaly taken into account. Removing the reject_if resolved all my problems. Now an empty form or a form not conform to the validates requirement is correctly rejected at the update_attributes step in the controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ruby on rails app I am trying to use a Prototype Form.Element.Observer
This is more a general question but my particular case involves a ruby/rails app
In my Ruby on Rails app, I have a User table and a Foo
I have a ruby on rails app running a server and sometimes it needs
I have a Ruby on Rails app running on my server, and I can't
I have a Ruby on Rails app that I've recently deployed to a remote
In a ruby on rails app, I build an array of Project Names and
I'm writing an Ruby on Rails app using a legacy database. The problem I'm
I am writing a Ruby on Rails app and I want a method to
I am using ActiveScaffold in a Ruby on Rails app, and to save space

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.