Ask A Question

Notifications

You’re not receiving notifications from this thread.

Nested forms with rows like a table

JM 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

Reply

Sounds like a fun little form. :)

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

Reply

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

Reply

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

Reply

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

Reply

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

Reply
Join the discussion
Create an account Log in

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

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

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