Autocomplete and parameters name

Hello,

new on Rails I have currently a problem. I am using autocomplete on a
search form it is working well but to paginate I need to call the search
action again and I don’t know how the variable should be named in
params.
Exemple:
my autocomplete is :ingredient :name so what should be the xxxxx in the
statement below
:url => {:action => “search_ing”, :params => {:xxxxx =>
@params[:ingredient][:name], :current_page => page}})

Thanks for your help
Nicolas

Hello again,

Just to tell you that

  • I have looked in the generated source and apparently the name of the
    autocomplete field is “ingredient[name]” but it is not working with that
    name

This is preventing me from continuing and deploying a new version for my
test users.

Thanks in advance for your help

Nicolas

Nicolas Aguttes wrote:

Hello again,

Just to tell you that

  • I have looked in the generated source and apparently the name of the
    autocomplete field is “ingredient[name]” but it is not working with that
    name

This is preventing me from continuing and deploying a new version for my
test users.

Thanks in advance for your help

Nicolas

Hello after several tries it seems that putting the name between quotes
works (it needs further testing to make sure I get the right results).
:url => {:action => “search_ing”, :params => {“ingredient[name]” =>
@params[:ingredient][:name], :current_page => page}})

I don’t know why, so there must be something I did not get with rails…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs