Getting params form submit_to_remote function

I’m trying do a search field using XHR form. Look this:

In view:
<% form_tag ‘dub0’ %>
<%= text_field ‘dub1’, ‘dub2’ %>
<%= submit_to_remote ‘btn_search’, ‘search it’, :url => { :action =>
‘my_search_controller’ }, :update => ‘some_div_in_my_html’ %>
<% end %>

In controller:

@results = Model.find(:all, :conditions => [“some_object = ?”,
params[:dub3]]

My several questions are:

What’s need i put in ‘dub0’, is it a general id name (used to format
html?)?
What’s need i put in ‘dub1’ and ‘dub2’, is it the id of text_field and
…?
What’s need i put in ‘dub3’, is it …?

Thanks for your attention!

Regards,

Luiz Vitor Martinez C.
cel.: (11) 8187-8662
blog: rubz.org
engineer student at maua.br

“Posso nunca chegar a ser o melhor engenheiro do mundo, mas tenha
certeza de
que eu vou lutar com todas as minhas forças para ser o melhor engenheiro
que
eu puder ser”

On Aug 18, 11:52 pm, “Luiz Vitor Martinez C.” [email protected]
wrote:

@results = Model.find(:all, :conditions => [“some_object = ?”,
params[:dub3]]

My several questions are:

What’s need i put in ‘dub0’, is it a general id name (used to format html?)?

Strictly speaking you don’t need anything. However it’s nice to put
the url/url parameters such that if javascript is not available the
submit will go the the right place

What’s need i put in ‘dub1’ and ‘dub2’, is it the id of text_field
and …?
‘dub1’ should be the name of an instance variable and dub2 a method on
that object. The text field’s initial value will be @dub1.dub2. I’d
guess you actually want text_field_tag, not text_field

What’s need i put in ‘dub3’, is it …?

Simple answer: look in development.log at the parameters that are
passed.

Fred