this simple question new. trying create dropdown menu values populated model. however, instead of displaying city names, getting record id's like: 0x007fee0b7442c0 (not sure if these called id's, think there term).
controller:
@cities = city.find(:all, select: "name") view:
<%= f.select(:city, @cities) %> what doing wrong?
if want name attribute database do:
@cities = city.pluck(:name) # => ["sydney", "melbourne", "canberra"]
Comments
Post a Comment