Sorry I did not provide more details. Another email has been sent with code
snippet from view (and included below). Please pardon my incompleteness as I
am very new to this type of development.
Is it okay to use a hidden field? I have seen talk of hidden fields in my
Google searches but do not understand how to use it, but then, I have been
focused on just assigning to the parameter. So, I will Google some more on
hidden field and focus on how that is done.
I have ...
<% @list_web_serv_cats.each do |category| %>
<!-- some html stuff here -->
<% form_tag({:controller => 'customers', :action =>
'list_services_available_at_location', :wsc_uid=>category['wsc_uid_pk']}) do %>
<%= category['wsc_uid_pk'] %> <!-- printing to view to verify data exists -->
<%= select_tag(:wsc_uid, '<option value="">Select Type</option>' +
options_for_select(@list_web_serv_types.collect{|servtype|
[servtype['wbt_description'].to_s, servtype['wbt_uid_pk'].to_i]},
params[:id].to_i)) %>
<!-- @list_web_serv_types uses param[:wsc_uid] to bring data from model/db
package call -->
<% @list_web_serv_types.each do |servtype| %>
<tr><td height="25px" align="left" valign="top" > <%=
servtype['wbt_uid_pk'] %> <%= servtype['wbt_description'] %> </td></tr>
<% end %> <!-- @list_web_serv_types.each end --> <% end %> <!-- form_tag
end --> </td>
<!-- next column: service category subtypes --> </tr> <% end %> <!--
@list_web_serv_cats.each end -->
Thank you,
Rachel S Nichol
Hargray's mission: To envision and deliver customer delight
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Colin Law
Sent: Thursday, June 18, 2009 9:33 AM
To: [email protected]
Subject: [Rails] Re: Param in View not being set
2009/6/18 Rachel Nichol <[email protected]>:
> Hello All,
>
>
>
> I have :wsc_uid=>category['wsc_uid_pk'] in my view so that I can use
> :wsc_uid parameter in my controller to pass to model. In my view I am
> printing category['wsc_uid_pk'] to see if there is data, and there is indeed
> data. So, why, when running debugger in controller, is params[:wsc_uid] =
> nil? Does anyone know what I could be doing wrong?
To get a parameter submitted it should be put in a field (hidden if
necessary) on the form. Assuming you are submitting a form that is.
Alternatively if going via a link it can be put as a parameter to the
link. You need to give us a few more clues as to what you are doing.
We are not telepathic (at least I am not).
Colin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---