Question

In the select dropdown element it shows instead of the string for City:

<option value="1">#<City:0x007f850028b220></option>
Était-ce utile?

La solution

Add to your City model:

class City
  def to_s
    name
  end
end

Replacing name with relevant attribute.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top