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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:02:30+00:00 2026-05-30T10:02:30+00:00

I installed this gem: https://github.com/crowdint/rails3-jquery-autocomplete and applied it successfully: class TagsController < ApplicationController autocomplete

  • 0

I installed this gem: https://github.com/crowdint/rails3-jquery-autocomplete

and applied it successfully:

class TagsController < ApplicationController
  autocomplete :name
end

I have a Tag model and I separate tags with a space in a tag! method:

class Post < ActiveRecord::Base
  attr_accessible :title, :content, :tags_attributes

  has_and_belongs_to_many :tags

  def tag!(tags)
    tags = tags.split(" ").map do |tag|
      Tag.find_or_create_by_name(tag)
    end
    self.tags << tags
  end
end

(It has a has_and_belongs_to_many relation with the Post model).

I created a post with these two tags: food drink.

Now the problem is that it autocompletes like this:

food
food drink

when I type food.

I want it to auto complete like this:

food

(when I type food)

and

drink

(When I type drink)

Any suggestions to fix this?

EDIT:

I’m starting to suspect that the gem is not working and this is the browser’s autocomplete.

  • 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-30T10:02:32+00:00Added an answer on May 30, 2026 at 10:02 am

    Hey you didn’t mention any model name in the

    autocomplete :name
    

    I think it should be like this , if you are using tag model to get name of tags

    autocomplete :tag , :name 
    

    Also it will be helpful for you , to see the request in browser console . It shows the status of request .
    Thanks

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

Sidebar

Related Questions

I'm using auto_complete plugin: https://github.com/crowdint/rails3-jquery-autocomplete I have installed the gem and added require line
I have installed the Enki (blogging) gem https://github.com/xaviershay/enki together with the Forem (forums) gem
I was trying to install this gem https://github.com/frodefi/rails-messaging into a rails application. The README
I'm trying to replace fixture generation with factories using rails3-generators: https://github.com/indirect/rails3-generators#readme The gem is
I installed the ckeditor gem: https://github.com/galetahub/ckeditor I followed all the steps and I'm displaying
I'm trying to install this gem: https://github.com/jongilbraith/simple-private-messages with bundle install. And I'm getting the
I'm using a variety of the GPGR gem (https://github.com/HHRy/gpgr) to do pgp encryption, and
I am making my way through these instructions https://github.com/phifty/agraph/blob/master/README.rdoc And I installed the gem
UPDATE: There's been a patch for this issue: https://github.com/collectiveidea/delayed_job/commit/023444424166ba2ce011bfe2d47954e79edf6798 UPDATE 2: For anyone running
I have installed Qt for windows CE using this link http://qt.nokia.com/products/platform/qt-for-windows-ce for visual studio8,

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.