Questions tagged [acts-as-taggable-on]

ActsAsTaggableOn is a Ruby on Rails gem for handling generic tagging.

ActsAsTaggableOn is a Ruby gem for Rails that handles associating records with arbitrary tags. It handles complex tag relationships, searching and allows you to categorize your tags (for example, as skills, movies, or whatever you want).

515 questions
21
votes
4 answers

How to get a list of all tags while using the gem 'acts-as-taggable-on' in Rails (not the counts)

I have set the acts-as-taggable-on gem in my model like this : acts_as_taggable_on :deshanatags It use the context deshanatags. Now I need to get a list of all the tags (not only the ones assigned for one item. I need everything) in this context…
THpubs
  • 6,509
  • 12
  • 52
  • 120
17
votes
1 answer

PG error for SELECT DISTINCT, ORDER BY expressions must appear in select list when trying to view on Heroku

I am getting this follow error after I added more relationships to my project. On localhost, the page displays perfectly fine. However, I get an error when trying to view it on heroku. ActiveRecord::StatementInvalid (PG::Error: ERROR: for SELECT…
Huy
  • 9,656
  • 10
  • 50
  • 92
16
votes
2 answers

Acts-as-taggable-on find all tags by context

So after searching for a tagging gem for my rails app I found the amazing acts-as-taggable gem. Installing it and playing around I discovered that it keeps all the Tags inside a tag db which just holds the Tag.name without the context, instead the…
16
votes
1 answer

Rails acts_as_taggable, tags losing comma on edit!? becomes one

~~~ SOLVED! ~~~~~ I am using acts_as_taggable_on gem with Rails 4.2 and I have a form where you can enter tags, seperated by commas.
<%= f.label(:tag_list, "Tags (seperated by commas)") %>
<%=…
nvrpicurnose
  • 587
  • 2
  • 4
  • 16
15
votes
1 answer

Order Tags Alphabetically By Default Using Acts As Taggable On

I'm using acts-as-taggable-on to allow my NewsItem and MediaItem models to be tagged. By default, accessing the model's tags using either tag_list for an array of the tag names or directly via an association using tags for collection of…
Undistraction
  • 38,727
  • 46
  • 165
  • 296
14
votes
6 answers

How to use jquery-Tokeninput and Acts-as-taggable-on

This is how you use autocomplete with jQuery Tokeninput and ActsAsTaggableOn. In my situation i am using a nested form but it shouldnt matter. Everything below is code that works. Code Product Model: attr_accessible :tag_list # i am using the…
14
votes
1 answer

After upgrading to rails 4.1, acts-as-taggable-on is not working

I have upgraded my rails version of one my app to 4.1.0. While upgrading I have upgraded all gems from Gemfile, which upgraded acts-as-taggable-on to 3.1.1 too. but after upgrade, when I tried to add tags on respective object, it is failing with…
13
votes
3 answers

undefined local variable or method `acts_as_taggable' in gem

I'm working on converting a plugin to a gem. In one of the models I'm using acts_as_taggable_on, and it looks like this class BlogPost < ActiveRecord::Base acts_as_taggable .... end However, I get this error when I run it: undefined local…
Markus
  • 2,306
  • 3
  • 23
  • 34
12
votes
3 answers

Rails - acts_as_taggable_on Removes Commas When Editing

I have successfully set up acts_as_taggable_on my model. As expected, when I split the tags with commas, it splits the tags correctly. However, when I edit the post the field is auto populated with the tags for editing, except the commas are now…
abbott567
  • 852
  • 6
  • 17
12
votes
1 answer

Manipulating tags with acts_as_taggable_on and ActiveAdmin

I have a Post model which I'm accessing through ActiveAdmin. It's also taggable using the acts_as_taggable_on gem. So the admin can add, edit or delete tags from a specific Post. The normal way to add the tagging functionality for the resource in…
12
votes
1 answer

Where do I place the configuration for Act-as-taggable-on?

I'm reading the act-as-taggable Github document, https://github.com/mbleigh/acts-as-taggable-on, and I want to force tags to be saved downcase. The instruction in the Configuration section says to add the line ActsAsTaggableOn.force_lowercase =…
Huy
  • 9,656
  • 10
  • 50
  • 92
11
votes
1 answer

Rails "acts-as-taggable-on": how to add tag *objects* to taggables, not by name

In a data importer, I have code which is attempting to add a bunch of ActsAsTaggableOn::Tag objects to a taggable's tag list: existing_item = FeedItem.where(url: item[:url]).first if existing_item.nil? new_item = FeedItem.new …
zwol
  • 121,956
  • 33
  • 219
  • 328
10
votes
4 answers

Return all tags based on context - ActsAsTaggableOn

I'm using the rails gem acts-as-taggable on, and am tagging posts on two contexts: tags and topics. To return a hash of all the topics tags used so far for posts I can use the code: Post.tag_counts_on(:topics) However, I have created a certain…
jay
  • 10,722
  • 16
  • 61
  • 98
9
votes
3 answers

acts_as_taggable_on: how to optimize the query?

I use acts_as_taggable_on in my current Rails project. On one overview page i am displaying an index of objects with their associated tags. I use the following code: class Project < ActiveRecord::Base acts_as_taggable_on :categories end class…
ErwinM
  • 4,671
  • 2
  • 20
  • 32
9
votes
1 answer

I want a user to be able to follow a topic(tag) that is created with acts_as_taggable_on in Rails 4

I have a question model much like stackoverflow. A user can add a question. In the question form there is :Title, :topics, :place, :description Each topic has its own show page which has a feed of questions that contain the topic. I want to add a…
Lewis Frost
  • 537
  • 1
  • 4
  • 24
1
2 3
34 35