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 }) %>
Middle eight caveat. Okay, it isn’t really the middle eight yet in terms of post lenght, but what the hey. I’m no Rails expert. In fact I’ve really only dabbled in it – so I’m happy to be shown better ways to do anything here. Don’t take my word as gospel because I’m new to Ruby on Rails….and I’m a bit of a lazy developer.
(more…)