Joined January 2013
·

Geordee Naliyath

Dubai, UAE
·
·
·

I had a feeling that I was looking for the impossible, or impractical one. ActiveRecord Store is another route I took. Only if the nested_form gem could cover some more scenarios.

Thanks for the and it was a great discussion.

Right. But, since I use RyanB's gem already for invoice items, it would be almost a duplication of logic, and that's how I thought of a hack and came across this article. Then I was wondering, will I be able to convince Rails that there is a hasmany relation and acceptsnestedattributesfor so that nested_form will generate the lines for me.

I intend to store it as a JSON string. I started with ActiveModel form, but the Nested Form was giving errors. In your article association and reflectonassociation are on the ContactList model, right? If I use it that way, other things (invoice items) break.

Say, I have an invoice model and multiple taxes attached to it. It may not be too many (unlike invoiceitems), so I was thinking of avoiding the invoicetaxes table and the join thereof. I was thinking of leveraging RyanB's nestedform for dynamically generating the tax lines. I am already using the gem for invoiceitems, so writing another set of helpers and JavaScripts isn't all that exciting.

Can I use ActiveRecord for the master entity and ActiveModel for the detail entity? I am trying to save the data for the detail into a text column in the master table itself.

Achievements
35 Karma
0 Total ProTip Views