I am using Rails 3 and trying to set up an association with a model called Reseller on a model called Company.
I also have a boolean field called reseller.
Therefore, the table companies has the columns reseller:boolean and reseller_id:integer.
I am getting an error when I have form_fields for these two column in my view:
undefined method 'to_i' for "#<Reseller:0x007fc081e3cfa8>":Reseller
The error is occurring where I expect the reseller:boolean field to be handled: <%= c.check_box :reseller %> and not the Reseller association.
Is there a way around this?
the moment you put
in you Company model, you got a conflict, since this will create reseller method for your association.
solution is to rename your boolean, or your association. You can also do the latter without changing the db: