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).

520 questions
0
votes
1 answer

Cannot sort posts by tag using acts as taggable on

I have a method in my posts_controller: def tag @posts = Post.all.tagged_with(params[:id]).page(params[:page]).per(10) render :action => 'index' end My routes file : resources :posts do collection do get :top get…
0
votes
1 answer

I want to acts_as_taggable_on :topics and :places in Ruby on Rails

I have a question model in my rails app. A user can add questions. When adding a question a user can assign it topics and a place. I followed the railscast on how to set up acts_as_taggable_on for tags, in my case topics. However, I now want to add…
Lewis Frost
  • 557
  • 1
  • 5
  • 25
0
votes
1 answer

Class methods on all search result using Sunspot

I have a model Item which has many tags (using acts-as-taggable-on) Using sunspot, I search for items like so: @search = Item.search do fulltext params[:search] paginate page: params[:page], per_page: 20 end This works fine but, for the items…
benjaminjosephw
  • 4,369
  • 3
  • 21
  • 40
0
votes
2 answers

Rails: has_many :through association only at one side

I am new to ruby and ruby-on-rails. I need to implement complicated tagging engine: each tag could have 0 or more synonyms (yep, just like on SO) there should be an hierarchy of tags: i.e. there are sub-tags and super-tags. Say, I have three tags:…
Dmitry Frank
  • 10,417
  • 10
  • 64
  • 114
0
votes
1 answer

How do I elegantly combine these two ruby commands?

I am using ActsAsTaggableOn on my Item model. To get a list of all the items tagged with a particular tag, I have to do this: Item.tagged_with("some_tag") However, I am using this in a navigation partial to dynamically generate navigation of tags…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
0
votes
0 answers

rails acts-as-taggable-on throwing error in production mode

I am using rails 3.2.1 and ruby 1.9.3p448. acts-as-taggable-on works fine in development mode but in production mode it throws an error below. NoMethodError: undefined method `association_class' for nil:NilClass from…
0
votes
1 answer

Adding a country tag separate from acts as taggable list

My goal is to find a way to add a new field in the submission form to gather what country the picture is from. I want to make the country searchable the same way any tag can lead to a page just with items containing that tag when using the…
0
votes
1 answer

Ruby on Rails: Acts as Taggable searching like terms

I'd like to search tags that has similar terms. For instance if there's a tag that has two words, christmas shopping, I'd like to search all that has similar tags with christmas or shopping. right now I have this @tag =…
0
votes
2 answers

profile belongs_to user but can't access user in controller

I have done this a million times and yet I can't seem to figure out why it is not working now. I have a user model that has_one profile. The profile belongs_to the user model. In my profile controller, I am trying to access all the profiles that…
0
votes
1 answer

rails - Search form in tags and title

I have an application where I have two models: debates and challenges. Every model has a title, and I use acts_as_taggable on both. I have a search form where I can search on every tags: view <%= form_tag ("/search_results"), :method => "get",…
0
votes
1 answer

Sort by post tag

I am using the acts_as_taggable_on gem to try and add tags to my posts. I am encountering a problem on the tag pages. They aren't properly filtered by tag but instead just show all the posts. This is odd because in my debugger…
0
votes
1 answer

Using acts_as_taggable_on gem and public_gem

I am using 'acts_as_taggable_on' gem for tagging. Now I have added another gem 'public_activity'. Now I want to generate an activity when a user creates a new tag. How can I achieve this? Where should I write the code for creating a new activity for…
Radhika
  • 2,453
  • 2
  • 23
  • 28
0
votes
1 answer

Indexing Method Results in ElasticSearch from Associated ActiveRecord Objects

I am following the example here for indexing ActiveRecord objects and associated objects in Elasticsearch. https://gist.github.com/karmi/3200212 Is there anything else that I would need to take into account if the associated object is storing the…
grumpasaurus
  • 732
  • 1
  • 6
  • 16
0
votes
1 answer

How to search using acts-as-taggable using conditions

I have a materials model which has a search form. The search action looks a bit like this: def search conditions = {} conditions[:version] = 'master' conditions[:status] = 'shared' conditions[:targ_lang] = params[:targ_lang] unless…
Finnjon
  • 651
  • 4
  • 19
0
votes
1 answer

acts_as_taggable_on finding in batches

Using acts_as_taggable_on to find a models instances with certain tags is done by something like this: Ninja.tagged_with(["invincibility,uber-strength", any: true) However, what if I have 2million ninjas in my ninja directory and want to run a job…