Hi, I’m having some problem with getting collection_select to return
the current value when editing a record. According to everything I’ve
seen, there was an issue but it’s been fixed, but I can’t figure out
why it isn’t returning the current value as a selected option. I’ve
checked the table structures, and both the call_driver.product_line_id
and the product_line.id are int(11).
What am I missing?
Here’s the code;
The controller;
def driver_edit
@drivers = CallDriver.find(params[:id])
@productline = ProductLine.find(:all)
end
And the debug results for CallDriver
— &id001 !ruby/object:CallDriver
attributes:
name: Billing (TV)
segment_id: “1”
platform_id: “1”
updated_at:
product_line_id: “3”
id: “2”
sub_product_line_id: “7”
consolidation_id: “1”
skill_id: “1”
created_at: 2008-01-10 20:04:04
attributes_cache: {}
Debug results for ProductLine;
-
!ruby/object:ProductLine
attributes:
name: RHP
updated_at:
id: “1”
created_at: 2008-01-09 20:16:56
attributes_cache: {} -
!ruby/object:ProductLine
attributes:
name: Internet
updated_at:
id: “2”
created_at: 2008-01-09 20:16:56
attributes_cache: {} -
!ruby/object:ProductLine
attributes:
name: TV
updated_at:
id: “3”
created_at: 2008-01-09 20:16:56
attributes_cache: {} -
!ruby/object:ProductLine
attributes:
name: Wireless
updated_at:
id: “4”
created_at: 2008-01-09 20:16:57
attributes_cache: {}