Jeremy Bray
Jeremy Bray

Reputation: 444

Add multiple rows to a column

I have a rails app with a building model, each building has multiple floors. Floors belong to buildings

My question is, in my building form how could i create multiple floors by simply asking the user to input the number of floors they require

Upvotes: 0

Views: 41

Answers (1)

quyetdc
quyetdc

Reputation: 1595

Well, you are asking to creating a dynamic nested form in Rails.

  • You can do it manually with Jquery & normal Rails form. This tutorial might help

enter image description here

  • Or You can try the Cocoon gem. It surely can help

Upvotes: 1

Related Questions