Hi, I''m really confused on how I should do it as I have a form as: ===============================================================================<%form_for :cart do |form|%> <div id ="campsites_list" > <p> <label for = "camp location">Campgrounds</label><br /> <%= form.select "campsite", %w{ ---- }, :class => "select_campsites" %> </p> </div> <p> <label for = "arrival date">Arrival Date:</label><br /> <%= form.text_field :arrival_date %> </p> <p> <label for = "nights">Nights:</label><br /> <%= form.text_field :nights %> </p> <p> <label for = "parents">Parents:</label><br /> <%= form.text_field :parents %> </p> <p> <label for = "children">Children:</label><br /> <%= form.text_field :children %> </p> <p> <label for = "family claim">Family Rate:</label><br /> <%= form.check_box "family_claim",{}, "1", "0"%> </p> <%=submit_tag "Calculate"%> <%end%> =============================================================================== Now div with the :id "campsites_list" gets updated with the _campsites.rhtml partial when ever I change the value of another combo box. _campsites.rhtml ===============================================================================<p> <label for="camp location">Campgrounds</label><br/> <%=select "camp", "id", @resultset %> </p> =============================================================================== I''m trying to save all the above details with @cart=Cart.new(params[:cart]) all gets saved except the value from the combo box so how can I save it as well... 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 -~----------~----~----~----~------~----~------~--~---
Or is it possible that i get all the textfield values from params[:cart] and the value of the combo box with params[:camp][:id] and squeeze them together and pass to Cart.new(squeezed_object) 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 -~----------~----~----~----~------~----~------~--~---
Could it be that your select for "camp" isn''t part of the form? View source for your page in the browser to make sure that your select is indeed part of the form, and that data should come back to you. -- 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 -~----------~----~----~----~------~----~------~--~---
Ar Chron wrote:> Could it be that your select for "camp" isn''t part of the form? > > View source for your page in the browser to make sure that your select > is indeed part of the form, and that data should come back to you.Ya, I couldn''t find it in the view source. I loaded that partial with updated values and then viewed the source but still its showing the code for the previous combo box only.. -- 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 Oct 10, 1:38 am, Jay Pangmi <rails-mailing-l...@andreas-s.net> wrote:> _campsites.rhtml > ===============================================================================> <p> > <label for="camp location">Campgrounds</label><br/> > <%=select "camp", "id", @resultset %> > </p> > ===============================================================================Shouldn't the select field in the partial be part of the form? IE: <%= form.select "camp", "id", @resultset %> Notice the "<%= form.select" in comparison to the original "< %=select". Hope that helps. -Nick --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 10, 1:38 am, Jay Pangmi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> <label for = "arrival date">Arrival Date:</label><br /> > <%= form.text_field :arrival_date %>By the way, you should also use the #label method, like this: <%= form.label :arrival_date, ''Arrival Date:'' %> Cheers, Nick --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nick wrote:> Shouldn''t the select field in the partial be part of the form? IE: > <%= form.select "camp", "id", @resultset %> > > Notice the "<%= form.select" in comparison to the original "< > %=select". > > Hope that helps. > -Nick<%= form.select "camp", "id", @resultset %> is an error coz the word form is no where to be found in the _campsites.rhtml. I tried using <%form_for :cart do |form|%><%end%> in partial file as well, but that stopped the updating of the <div> with this partial. So, couldn''t get thru.. -- 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 -~----------~----~----~----~------~----~------~--~---