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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:32:44+00:00 2026-06-11T01:32:44+00:00

I have a Flight model nested inside a FlightLog model. A FlightLog may contain

  • 0

I have a Flight model nested inside a FlightLog model. A FlightLog may contain many flights.

I’m using SimpleForm with the bootstrap installation, which makes it possible to surround form elements with errors with the error class when a validation fails.

The problem is, that even though validations are triggered for the nested model, the fields with errors inside the simple_fields_for are not being marked, so it’s not possible to determine which attribute is not valid.

After examining the errors hash when calling the create action, I can see that it is correctly populated with the errors at the top level, and the errors of the nested resources inside each resource.

How could I modify the behavior of simple_form to add the errors class to the control group of each nested model to match the behavior of the parent?

Thanks in advance.

enter image description here

  • 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-11T01:32:45+00:00Added an answer on June 11, 2026 at 1:32 am

    I have been using custom accessors instead of the _id fields, so that’s why they weren’t getting notified when they had errors. I finally resolved to use f.error :attr_name under each accessor and changing the styling manually with JS

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

Sidebar

Related Questions

I have a flight reservation program use mssql ,For reserving flights i want to
I have declared an ArrayList and DefaultListModel DefaultListModel model; List<AddFlight> Flights = new ArrayList<AddFlight>();
I have a User model that has many fights. Fight belongs to User. There
HI, I have the following model: @Entity class Flight{ private Airport airportFrom; private Airport
I have a mysql table which has data from all flight bookings on my
I have two classes, as follows: public class Route { public ObservableCollection<Flight> Flights =
I have a table which holds flight schedule data. Every schedule have an effective_from
I Have a USB RC flight simulator controller which is defined in the computer
I have a booking system, in which once a user books a flight, their
I have an application where i show Flight Departure Date and Arrival Date and

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.