On 24 February 2011 14:25, Vadim Antropov <[email protected]> wrote: > _locations.html.erb > -------------------------- > <p><%= label_tag :location %><br /> > <%= collection_select (:location_id, locations, :id, :location_name, > {:prompt => "Select an Location"}, {:onchange => > "#{remote_function(:url => {:action => "update_cities"}, :with => > "'location_id='+value")}"}) %></p> > -------------------------- > > _cities.html.erb > -------------------------- > <p><%= label_tag :city %><br /> > <%= collection_select(:city_id, cities, :id, :city_name, {:prompt => > "Select a City"}) %></p> > -------------------------- > > what to do with partials? > > new error: > > -------------------------- > NoMethodError in Devise/registrations#new > > Showing > C:/projects/djob/app/views/devise/registrations/_locations.html.erb > where line #2 raised: > > undefined method `map' for :id:Symbol > Extracted source (around line #2): > > 1: <p><%= label_tag :location %><br /> > 2: <%= collection_select (:location_id, locations, :id,
You are still using the syntax for f.collection_select, but are just using collection_select. Check the docs for that method, you need an extra parameter before :location_id. See http://ap.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M000455 Colin > :location_name, {:prompt => "Select an Location"}, {:onchange => > "#{remote_function(:url => {:action => "update_cities"}, :with => > "'location_id='+value")}"}) %></p> > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

