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 6976627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:31:17+00:00 2026-05-27T17:31:17+00:00

I want to implement auto complete feature in a rails application. I am using

  • 0

I want to implement auto complete feature in a rails application. I am using the jquery auto complete plugin.

I want to implement the auto complete feature for the following array.

  @testers = User.find_by_sql("select * from users where id in(select user_id from user_role_assignments where role_id in (select id from roles where name like 'Tester')) order by name").paginate(:page=>params[:page],:per_page=>30)   

I want to pass this in json format to the .js file. I tried using the below code code in my view file.But the auto complete is not populating the data.

= form.label :tester_tokens, "Testers" 
        = form.text_field :tester_tokens
        - @testers.each do |tester|
          %tr
            %td=tester.name
            %td=check_box_tag "release[tester_ids][]", tester.id, @release.is_tester_assigned(tester)
      //=will_paginate @testers

:javascript
var data="#{escape_javascript @testers.to_json}";    
= javascript_include_tag :defaults,:cache => true

My .js file:

$(document).ready(function() {  

$.parseJSON(data);
  alert (data);
 $('#release_tester_tokens').autocomplete({source:data}); 

 });

Please help me out here.

  • 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-27T17:31:17+00:00Added an answer on May 27, 2026 at 5:31 pm

    You’re discarding the value returned by $.parseJSON.

    $(function() {
        data = $.parseJSON(data);
        console.log(data);
        $('#release_tester_tokens').autocomplete({source:data}); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate a comma separated auto complete list in my rails application.With
I want to implement an ISAPI filter like feature using HttpModule in IIS7 running
My requirement is to implement auto complete in my text box with my rails
Does anybody know how to implement the jQuery autocomplete plugin in Django, using databases
I want to implement a 'Search with Auto complete drop down' but I don't
I've found this nice jquery plugin tag it! http://levycarneiro.com/2010/03/tag-it-tag-suggestions-editor-and-autocomplete-in-a-jquery-ui-plugin/ and want to implement it
I am using tinymce editor in my asp.net application, I want to implement the
I want to implement an autocomplete feature with images in my website. I would
I want to implement an automatic update system for a windows application. Right now
I want to make an application which has auto start option in its settings.

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.