I'm working on a rentals system. I have a model called check_outs
which is a child of a rental order
where an order has_many :check_outs
and a check_out belongs_to :rental
. My order accepts_nested_attributes_for :check_outs
and I have a nested fields_for :check_outs
. I'm using rbates' nested_form gem.
What I'm trying to do is get a property of the rental (description, an attr_accessor of check_outs), that was set in the checkout creation step, to populate a label or text field in the edit view.
I know I can get the check_out object it self using builder.object
and I can even get builder.object.rental
but when I try to get builder.object.rental.id
or builder.object.rental.description
I get an unknown attribute for nil error. This doesn't seem to make sense since the object itself is not nil.
Any ideas?