All threads / Nested forms with rows like a table

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Nested forms with rows like a table

John Munyi asked in General

Hi Chris,

I am battling nested forms , but not your standard .. what I want is a situation where the form behaves like a table where each new row will represent the object from the partial(nested-fields) and if possible populate some data and then i can mass update the other fields.... picture a class register when you can mass update present or absent .....

As a form it works but i dont want to replicate the labels any leads?

cheers

Sounds like a fun little form. :)

So you have a working form but wan to make it look like a table? Is that correct?

Yes I have a working nested form.

So I want it to look like a table with heading and also pre load some fields with data

You could either do this with CSS or you can probably just wrap the form around a table and put the fields inside the cells like this: https://www.cs.tut.fi/~jkorpela/forms/tables.html

Will check-it out and let you know how it goes

Hi Chris the table worked brilliantly.. but i am still struggling with automatically populating the nested form with related record.. is it even possible in the first place ? such that if one selects a team drop down and click add attendance a specific number of rows are added with the team members names of the persons in that team and all is left is to check absent or present

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,344+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.