# Form nested parameters issue

**URL:** <https://www.ruby-forum.com/t/form-nested-parameters-issue/88098>\
**Category:** Rails\
**Created:** [March 8, 2007, 5:12am UTC](https://www.ruby-forum.com/t/form-nested-parameters-issue/88098 "2007-03-08T05:12:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TuteC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@TuteC](https://www.ruby-forum.com/u/TuteC)\
**Post date:** [March 8, 2007, 5:12am UTC](https://www.ruby-forum.com/t/form-nested-parameters-issue/88098/1 "2007-03-08T05:12:57Z")

</div>

Hello everyone. I’m doing something similar to the AJAX based search  
facility presented the Friends of ED book, but it doesn’t work for  
non-javascript browsers, so I’m trying to improve it.

The search engine looks like:  
\<% form\_remote\_tag :url =\> { :action =\> :search } do %\> #For non AJAX  
Search: \<%= text\_field “product”, “search” %\>  
\<%= submit\_tag “Buscar” %\>  
\<% end %\>  
\<%= observe\_field :product\_title,  
:frequency =\> 1.0,  
:update =\> ‘products’,  
:url =\> { :controller =\> ‘store’, :action=\> ‘search’ },  
:with =\> “‘search=’ + encodeURIComponent(value)” #AJAX  
%\>

And this action checks if ‘search’ has something similar to any  
product title in the DB:  
def search  
@products = Product.find(:all,:conditions =\> [“lower(title) like  
?”,"%" + params[:search].downcase + “%”])  
(…)  
end

Searching for “traxxas” with JS enabled works, and it prints in  
development.log the following:  
Parameters: {“search”=\>“traxxas”, “action”=\>“search”,  
“controller”=\>“store”}

With JS disabled development.log shows:  
Parameters: {“commit”=\>“Filter products”,  
“product”=\>{“search”=\>“traxxas”}, “action”=\>“search”,  
“controller”=\>“store”}

So I can’t accede to “search”=\>“traxxas”, which is inside product,  
from the search action (params[:search].downcase gets nil.downcase).  
How can I figure this out?

Thanks in advance;  
Eugenio Costa.
