On 27 December 2011 02:45, Bruno Meira <[email protected]> wrote:
> Hi Marco,
> If I understand your question, Do you want to fill in one form many models.
> Am I right?

Yes but one of the models is the join model of a has_many :through relation.
Company has_many :categories, :though => :categorizations
Classification has_many :categorizations
Categorization
belongs_to: company
belongs_to: category
belongs_to: classification

Categorizations attributes are:
company_id: integer
category_id: integer
classification_id: integer
amount: decimal

When I create a new Company with a category associated  a join model
categorization is magically created with company_id and category_id
setted, ok?
I want be able, in the same form, setting also classification_id and
amount, so that, when the join model is created, it have company_id,
category_id, classification_id and amount all setted
Classification_id is taken from a collection:

= collection_select :categorization, :classification_id,
@classifications, :id, :classification_type

Is it possible to do that?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to