Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7012967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:19:30+00:00 2026-05-27T22:19:30+00:00

Using Rails 3.1.1. & ‘rails3-jquery-autocomplete’ I think this question should be quite simple for

  • 0

Using Rails 3.1.1. & ‘rails3-jquery-autocomplete’

I think this question should be quite simple for anyone using the rails3-jquery-autocomplete gem but I can’t find any info on it on www. I have a very straightforward setup of the rails3-jquery-autocomplete and it is working fine.

Using:

<%= f.autocomplete_field :query, autocomplete_search_result_query_search_results_path %>

where query is a column in my search_result table.

The search_results table also have a status_id-column where 1 = OK and 2 = NOT OK.

Thus, I want :query to be filtered so that only queries where status_id = 1 is fetched. How can I do that? As it is now all queries are fetched.

Putting it simple I want “:query” to equal select query where status_id = 1.

Controller:

  autocomplete :search_result, :query, :full => true

Routes:

  resources :search_results, :only => [:index, :show, :new, :create], :path => 'sokresultat' do
    get :autocomplete_search_result_query, :on => :collection
  end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:19:30+00:00Added an answer on May 27, 2026 at 10:19 pm

    I realized I should probably used :scope but I could never make that work. Instead this ticket solved the problem for me Rails gem rails3-jquery-autocomplete how to scope by user

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this select_tag using Rails 3 <%= select_tag :area_id, options_from_collection_for_select(@areas.sort_by(&:name)), {:onChange => remote_function(:with
I am using Rails & jQuery. Here is HTML which I get: <head> <title>Some</title>
I'm using Rails 3 & mogli to connect to facebook. This code get's me
Using Rails 3.1.1. This is my YAML file in config/app_config.yml development: &non_production_settings site_url: http://localhost:3000
I'm using rails, but doing all my Javascript unobtrusively using jQuery in application.js .
I am using Rails and jQuery, making an ajax call initiated by clicking a
Using: Rails 3.0.3 & Heroku & Execution Notifier & New Relic I get a
Using: Rails 3.0.3 & Heroku & Exception notifier & New Relic etc. I am
I'm using Rails 3.1, MySQL and working with 3 classes: Computer, LifecycleStatus & LifecycleEntry
Using Rails, I would like to add: <span class='req'>&bull;</span> within my <label> tags in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.