I''ve got a partial that I''m trying to refresh, but I don''t get back any results, nor do I see any errors in Firebug. I''m guessing there''s a problem with the DOM, but I''m not sure. Can someone else take a look and let me know where I''m missing something? Controller: def get_city_list @show_javascript = true @counties = StateList.find_by_state_code(params[:state_code]) render :update do |page| page.replace_html ''city_select'', :partial => ''city_list'' end View: <%= collection_select (:state_code, :state_code,StateList.find(:all, :order => "state ASC", :select => ''distinct state, state_code''), :state_code, :state, {:prompt => ''Select a state''}, {:id => :state_code }) %> <div id="city_select"> </div> <%= observe_field :state_code, :url => {:action => ''get_city_list''}, :with => ''state_code'' %> THANKS! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 20 Mar 2008, at 13:38, Becca Girl wrote:> > I''ve got a partial that I''m trying to refresh, but I don''t get back > any > results, nor do I see any errors in Firebug. I''m guessing there''s a > problem with the DOM, but I''m not sure. Can someone else take a look > and let me know where I''m missing something? > > <%= collection_select (:state_code, :state_code,StateList.find(:all, > :order => "state ASC", :select => ''distinct state, state_code''), > :state_code, :state, {:prompt => ''Select a state''}, {:id > => :state_code > }) %> > > > <div id="city_select"> </div> > > > <%= observe_field :state_code, :url => {:action => ''get_city_list''}, > :with => ''state_code'' %> >Have you checked that state_code is actually the id of the form element you''re interested in? I would expect it to be more like state_code_state_code based on what you''ve got above. Fred> THANKS! > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> Have you checked that state_code is actually the id of the form > element you''re interested in? I would expect it to be more like > state_code_state_code based on what you''ve got above.Thanks for your help. I had thought that I needed to observe :state_code, but I actually needed to observe ''state_code'' THANKS!!! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---