acts-as-taggable

Rails 3 tagging problems, acts_as_taggable_on

僤鯓⒐⒋嵵緔 提交于 2020-01-03 04:18:04
问题 I'm using acts_as_taggable_on to add tags to posts, other tagging plugins/gems don't work with rails 3. I can edit/display tags on the post model and the tags controller displays the posts tagged by name i.e /tags/post-tag-name/. The functionality I want is to turn the tags on the posts pages into links to display the other posts with the same tag. I followed the tutorial in sitepoints 'simply rails 2' which uses acts_as_taggable_on_steroids but I'm stuck with the following error; ActionView:

Rails count article per tag and related article by tag

允我心安 提交于 2019-12-25 06:57:51
问题 Hey guys I'm new to rails and try to do something I never did before. First I now Rails have the gems acts_as_taggable but I try it and didn't work for me maybe need to learn how to install him(have already install acts_as_votable). So this is my question, I want to show related articles(with tag) for each article show. And also want to put the article.count by tag into my label. article.rb class Article < ApplicationRecord acts_as_votable belongs_to :category belongs_to :user has_many

How do I show the top ten tags?

血红的双手。 提交于 2019-12-23 04:35:37
问题 I have an app with Tags and it works great, but I was wondering if there was a way to restrict the tag cloud to only the MOST POPULAR tags? Right now it looks like it's ordering my cloud by the order in which the tags were created and I have a limit of ten in in my tags_count method inside my MODEL. I used "Tagging" to do it from scratch, and I am not using acts_as_taggable . Controllers: class DailypostsController < ApplicationController def index if params[:tag] @dailyposts = Dailypost

find all children of an object tagged with acts_as_taggable_on

為{幸葍}努か 提交于 2019-12-21 22:52:05
问题 I have a rails site with two models: events and dates events has many dates events are tagged using acts_as_taggable_on I'm trying to find all dates (chronological order) for events tagged with a specific tag. I can figure out how to get all the tagged events, but I can't figure out how to get all of the dates. The end result I'm looking for is to create a calendar of similar events where events appear on each of their dates. Hopefully that makes sense, thanks for any and all input! 回答1: As

Rails finding all posts with certain tags without using acts_as_taggable

本秂侑毒 提交于 2019-12-13 17:33:38
问题 So I'm trying to learn rails and I don't want to cheat just yet. post model: class Post < ActiveRecord::Base has_many :features has_many :tags, :through => :features end tag model: class Tag < ActiveRecord::Base has_many :features has_many :posts, :through => :features end join table: class Feature < ActiveRecord::Base belongs_to :tag belongs_to :post end I already know how to associate posts with tags by doing: Post.find_by_id(1) << Tag.first Now, I'm stuck on searching for posts with

Does the :any flag overwrites the :on (context) flag in acts_as_taggable_on's tagged_with?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 04:15:42
问题 I'm confused with how the flags :on and :any works together in the "tagged_with" method of acts_as_taggable_on. For example, if I have the following users @user1 and @user2: class User < ActiveRecord::Base acts_as_taggable_on :skills, :interests end @user1 = User.new(:name => "Bobby") @user1.interest_list = "1, 15" @user1.skill_list = "2, 17" @user1.save @user2 = User.new(:name => "Al") @user2.interest_list = "3, 10" @user2.skill_list = "4, 6" @user2.save When I want to get all users who's

Trouble saving tags in Ruby on Rails 4 with acts_as_taggable

泄露秘密 提交于 2019-12-05 05:11:59
问题 I'm trying to implement act_as_taggable into my Rails 4 app (upon the microposts model), but the program isn't saving the tags, which therefore aren't viewable. The tables for tags and taggings have been raked and exist in the database, but none of the code I'm implemented seems to save a tag or create a tag when the form is submitted. I followed the steps in this tutorial near exactly, but something doesn't seem to work. I'm not sure if it's a rails 4 centric problem and/or is connected to

Trouble saving tags in Ruby on Rails 4 with acts_as_taggable

China☆狼群 提交于 2019-12-03 22:06:58
I'm trying to implement act_as_taggable into my Rails 4 app (upon the microposts model), but the program isn't saving the tags, which therefore aren't viewable. The tables for tags and taggings have been raked and exist in the database, but none of the code I'm implemented seems to save a tag or create a tag when the form is submitted. I followed the steps in this tutorial near exactly, but something doesn't seem to work. I'm not sure if it's a rails 4 centric problem and/or is connected to the lack of 'attr_accessible' code used in rails. Since the code example doesn't specify adding anything

Thinking Sphinx and acts_as_taggable_on plugin

孤人 提交于 2019-11-28 19:01:47
I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For

How to add tagging with autocomplete to an existing model in Rails?

▼魔方 西西 提交于 2019-11-28 02:48:30
I'm trying to add "tags" to an Article model in a Rails 3 application. I'm wondering if there is a gem or plugin that has adds both the "tagging" functionality in the model and also the auto-complete helpers for the views. I've found acts_as_taggable but I'm not sure if that's what I should be using. Is there something newer? I'm getting results from 2007 when I google acts_as_taggable Tim Santeford acts_as_taggable_on and rails3-jquery-autocomplete work nicely together to make a SO like tagging system see example below. I don't think a suitable all in one option exists yet for rails. Follow