Hello,
is there any way to pass additional parameters (e.g. a string) from the
text_field_with_auto_complete to the controller?
Indra
Hello,
is there any way to pass additional parameters (e.g. a string) from the
text_field_with_auto_complete to the controller?
Indra
You can use the :url option. The symbols you set after :action will be
appended to the querystring.
<%= text_field_with_auto_complete :my_field, “Enter some text”, {:url
=>{:action => ‘auto_complete_action_name’, :my_param =>
“hello”}, :method => :get} %>
best.
mike
Thank you!
That’s exactly what I was looking for.
Indra
this didn’t work for me
<%= text_field_with_auto_complete :search, :contains,
{:url => {:action =>
“auto_complete_for_search_contains”,
:language => “English” }, :method => :get} %>
produced
Parameters: {“search”=>{“contains”=>“a”},
“authenticity_token”=>“2c9f26a81557318a3d7ce1ff64bc57bea43c5fdc”,
“controller”=>“phrases”,
“action”=>“auto_complete_for_search_contains”}
i tried pretty much every combination of :url :html and curley braces
that is humanly possible and nothing seemed to work, any suggestions?
Rails 2.0.2 running
script/plugin install
http://svn.rubyonrails.org/rails/plugins/auto_complete
On Jun 4, 8:34 am, “Indra M.” [email protected]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs