How to get value from partial

Hi, I’m really confused on how I should do it as I have a form as:

================================================================================
<%form_for :cart do |form|%>

Campgrounds
<%= form.select "campsite", %w{ ---- }, :class => "select_campsites" %>

Arrival Date:
<%= form.text_field :arrival_date %>

Nights:
<%= form.text_field :nights %>

Parents:
<%= form.text_field :parents %>

Children:
<%= form.text_field :children %>

Family Rate:
<%= form.check_box "family_claim",{}, "1", "0"%>

<%=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

Campgrounds
<%=select "camp", "id", @resultset %>

================================================================================

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.

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…

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.

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…

On Oct 10, 1:38 am, Jay P. [email protected]
wrote:

_campsites.rhtml

Campgrounds
<%=select "camp", "id", @resultset %>

================================================================================

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 [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
-~----------~----~----~----~------~----~------~–~—

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

with this partial. So, couldn’t get
thru…

On Oct 10, 1:38 am, Jay P. [email protected]
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