Hi Everybody,
My name is Marcelo Ruiz, software developer from Argentina starting to
work with rails.
I’m building a web app to track traffic information for roads. We have
operators that create Reports associated to each Segment of different
Roads.
I have the following models:
- Road (has_many :segments)
- Segment (belongs_to :road has_many :reports)
- Report (belongs_to :segment)
The requirement is that I have to show up only one form per Road, so
the operator can load the Reports for all the Segments in that Road at
once.
This would be something similar to this:
Road “Route 55”
Report for Segment 1: (text field)
Report for Segment 2: (text field)
Report for Segment 3: (text field)
(SUBMIT BUTTON)
This means that I will have to:
- Dinamically generate the fields, according to the number of
segments the selected Road has. - Create multiple Reports at the same time.
Any advise on how to do this?