views:

212

answers:

2

Hi, I've been trying to trace this error for nearly 2 days now and i can't seem to understand what is going wrong. I'll explain:

I have 2 views (.html.erb format) ViewA has the following

<% form_tag (:action => 'ViewB') do %>

i have on this page a select_tag radius

text_field_tag searchQuery (disabled as is filled in already),

text_field_tag subSearch

text_field_tag LAT <%= text_field_tag 'LAT', "", :disabled => true, :size => 15, :id =>'LAT' %>

and another identical to LAT named LNG instead

and lastley a submit_tag Locate

When ViewB is being loaded, i am noticing the following from the ruby console:

  Parameters: {"subSearch"=>"Management Consultants", "commit"=>"Locate", "authenticity_token"=>"XXJ+sfl2HkoInaj/1fNtIYpVLJ4NjTjJHY2oe18RPXs=", "radius"=>"5"}

I cant understand why the other parameters are not being passed! Although they are disabled i believe this should effect them from being transmitted, (i have tried re-enabling them to no avail).

Does anyone have any ideas please? what am i doing wrong? I really require the Lat and Lng!

Thanks in advanced for any tips / help

A: 

As suggested by Phil Ross, the answer was to enable them! silly me!

Erika
+1  A: 

If you want to have the controls disabled and still submit the values, you could use hidden inputs in addition to the disabled text controls:

hidden_field_tag('LAT', '', :id => 'LAT_hidden')
Phil Ross
Thanks so much!!
Erika