0

I am using autocomplete gem to populate the data while entering the text. i followed autocomplete doc. In my routes i added

gem 'rails-jquery-autocomplete'

in downloads_controller

  autocomplete :downloads, :fund, :full => true

in application.js

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require jquery-ui
//= require autocomplete-rails

in routes file

 resources :downloads do
  get :autocomplete_downloads_fund, :on => :collection
end

in view

<%autocomplete_field_tag 'fund', '', downloads_autocomplete_path, :size => 75%>

when i run this i get,

undefined local variable or method `downloads_autocomplete_path' for #<#

my rake routes

autocomplete_downloads_fund_downloads GET    /downloads/autocomplete_downloads_fund(.:format) downloads#autocomplete_downloads_fund
                        downloads GET       /downloads(.:format)                                downloads#index

here downloads is a table name and fund is the attribute name,

Download is the model name

can anyone help me..

1 Answer 1

3

Update the link:

<%= autocomplete_field_tag 'fund', '', autocomplete_downloads_fund_downloads_path, :size => 75 %>

Check all available routes:

rake routes
Sign up to request clarification or add additional context in comments.

3 Comments

Paste output of rake routes
That's another issue. You can add a new question and paste link here (if you like to)
@vjnan369 On SO, you should maintain the individuality of each question. So that others can get benefit from your question. Let's not make it a thread.

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.