Learning Ruby on Rails- Drop Down Lists in One to Many Relationships

If you are just looking for some help without reading my rambling post……
the short answer is, collection_select – something like this:

<%= collection_select(:city, :country_id, @countries, :id, :country_name, {:prompt => false}) %>

not f.select as I did the first time round

<%= f.select('country_id', @countries.collect {|r| [h(r.country_name), r.id] }, { :include_blank => false }) %>

🙁

Continue reading Learning Ruby on Rails- Drop Down Lists in One to Many Relationships