Reputation: 11
I'm new to web development and ruby on rails and I'm copying other websites for practice.
Right now I'm trying to make a copy of BiggerPockets "rehab estimator tool", which have several features i would like to implement in my own end project.
I'm not sure how to structure the project and would like some feedback on my ideas.
Model: I was thinking about generating a model "rehabJob" and "rehabReport", making rehabJob correspond to every line (ex. roof replacement, totalOnly, price: 2000 USD) and rehabReport begin a model containing a reportTitle and other rehabJobs (ex roof replacement, paint jobs, new flooring etc.)
How would I submit a form with multiple rehabJob models, with only 1 submit button
Ideas of how to implement the "delete/adding" of new lines (rehabJobs)
The link for the tool: https://www.biggerpockets.com/rehab-estimator/new
Image of biggerpockets rehab estimator tool:
Upvotes: 1
Views: 45
Reputation: 36860
In your shoes I'd take a look at the coccoon
gem which provides easy tools for adding / removing nested records. They give easy instructions on usage at their site. https://github.com/nathanvda/cocoon
Upvotes: 2