0

I'm using rails3-autocomplete-jquery. I've got the basic case working on my app. The basic case is for the code stated below of autocomplete :vendor, :name_en

I've dedicated my a controller to deal with autocomplete called auto_controller.rb

class AutoController < SplashController
  autocomplete :vino, :wine_name
  autocomplete :vendor, :name_en
end

Routes.rb

get "auto/autocomplete_wine_name" => "auto#autocomplete_wine_name", :controller => 'auto', :action => "autocomplete_wine_name", :via => :get
get "auto/autocomplete_vendor_name_en" => "auto#autocomplete_vendor_name_en", :controller => 'auto', :action => "autocomplete_vendor_name_en", :via => :get

I'm getting an unknown action when I access /auto/autocomplete_wine_name, but when I access /auto/autocomplete_vendor_name_en it works okay. The error I get is as follows:

Unknown action

The action 'autocomplete_wine_name' could not be found for AutoController

1 Answer 1

1

I think you forgot the class name (vino) in your route, shouldn't your routes file be:

get "auto/autocomplete_vino_wine_name" => "auto#autocomplete_vino_wine_name", :controller => 'auto', :action => "autocomplete_vino_wine_name", :via => :get
Sign up to request clarification or add additional context in comments.

1 Comment

That it's it. Thanks for the prompt response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.