1

I have a Repair model which currently has may too many fields in the database - http://i.qyk.in/b0DwJ.png. This can be a pain for testing and I'm guessing it will be in the future as well.

I am looking to have a way to create custom form fields which will only be linked to this Repair model. I'm just curious as to how I would go about doing this?

These custom form fields would also need to accept content as well.

I'm guessing I would be using has_many and that?

Could someone point me in the right direction?

1 Answers1

0

That does sound like a has_many, probably with nested attributes (http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html) This question has some decent pointers on using nested attributes. I hope this at least gets you started in a useful direction.

Community
  • 1
  • 1
MrTheWalrus
  • 9,670
  • 2
  • 42
  • 66