Displaying 20 results from an estimated 8000 matches similar to: "acts_as_taggable and deleting tags"
2006 Jan 19
4
create an object from a string?
I''m trying to dynamically create an instance of an object at runtime, from a
String. I have a method that returns one of a number of Strings ("Car",
"Motorcycle", "Bicycle"), and when I receive the String, I then want to
instantiate one of those objects.
Seems like there should be a way to do it in Ruby, but maybe I''ve been up
too long --
2006 Mar 27
0
acts_as_taggable not loading in dev environment?
It seems in my development environment I keep throwing:
undefined local variable or method `acts_as_taggable'' for Item:Clas
Indicating that the acts_as_taggable pluggin is not loading, yet in my test
enviroment I can run tests against act_as_taggable methods for that very
same class just fine.
Has anyone else experienced this?
Tim Case
tim@karmacrash.com
-------------- next part
2006 Jan 16
15
where''d we come from?
I''m curious -- how many of us came to Rails from other branches of the OO
world -- Java, C# -- and how many of us came from the design or non-OO
scripting worlds?
Reason I ask is that I''m finding Rails a blast and very productive, but I
think one reason is that I already cut my teeth on MVC and ORM during two
years of writing apps with J2EE/Struts/Hibernate. And in Javaland, it
2006 Nov 11
0
acts_as_taggable plugin - paging through tagged model
Hi,
I''m using the acts_as_taggable plugin & wanted to page through all a
model''s records taggged with a particular tags.
i.e. page through all Model records that have been tagged with "artist"
I could not work out how to do this with the plugin, so I made the
changes outlined below.
Did I need to do this..? & does anyone else find this useful?
2006 Apr 10
2
acts_as_taggable with only 1 taggings table
I was reading rails recipes and it shows how to use acts_as_taggable
with only 2 tables, a tags and a taggings table.
But I think that its related to an older acts_as_taggable version
because now it seems that it works with one tags table and one taggings
table for each tagable model, like this:
tags
photos
tags_photos
Which means I need one new table for each model I want to tag.
2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
Hello,
I have a few models -- book, cd, dvd -- for which I''d like to have an
abstract base superclass to hold some common stuff. That abstract class, I
was thinking, would inherit from ActiveRecord.
Didn''t work, though, and looking around, I found this:
<http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel>
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of
the acts_as_taggable plugin, but related to quoting/sanitizing the
interpolated list in a find_by_sql. Apologies for the length, but I
wanted to be complete. ;-)
The method from acts_as_taggable.rb is:
def find_tagged_with(list)
find_by_sql(["SELECT #{table_name}.* FROM #{table_name},
tags,
2006 Feb 16
1
[PATCH] acts_as_taggable plugin
hi,
I started today to use the acts as taggable plugin and it''s working as
expected.
I added a method find_tagged_with_all since I needed to find the
elements tagged with all the items in a list while find_tagged_with
finds all the elements tagged with any of the list terms.
Attached to this mail there''s a patch which adds the
find_tagged_with_all method and which solves a
2006 Aug 10
2
search acts_as_taggable for multiple tags
Hey...I''m trying to search a Model that uses acts_as_taggable for multiple tags. I''d like to pass in a search string containing a space delimited tags names (i.e. "tag1 tag2") and return the objects that have been tagged by either one of those. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Feb 09
0
acts_as_taggable Generating Funky SQL
I am using acts_as_taggable in my application and on the tagging side of
things, no problem at all. Running edge Rails and PostgreSQL 8.1.
I am then trying to find all my AR objects with a certain tag. The tag is:
lasvegas and I know that there are at least 3 records with that tag.
So, I''m doing this:
@lists = List.find_tagged_with :any => @search_string, :separator =>
2006 Feb 09
3
acts_as_taggable Produces Bad SQL - Find Fails
I am using acts_as_taggable in my application and on the tagging side of
things, no problem at all. Running edge Rails and PostgreSQL 8.1.
I am then trying to find all my AR objects with a certain tag. The tag is:
lasvegas and I know that there are at least 3 records with that tag.
So, I''m doing this:
@lists = List.find_tagged_with :any => @search_string, :separator =>
2006 Mar 17
0
validations using acts_as_taggable
Can anyone provide me an example of how they are displaying validation
errors when saving a tag using Demetrius''s (not DHH''s) act_as_taggable
plugin?
For example, the tag model has a
:validates_length_of :name, :in => 1..30, :too_long => "Tag name too long -
max 30 characters", :too_short => "Tag must have a name"
If a user inputs a tag longer than
2006 Apr 26
3
acts_as_taggable gem: deleting tags
I have the following quick-and-dirty hack in my model:
def after_destroy
# search for orphaned tags and delete them
orphans = Resource.tags_count :count => ''= 0''
orphans.keys.each {|tag| Tags.find_by_name(''tag'').destroy}
end
It''s nice from a readable code perspective, but it seems inefficient -
is there some way to do this with only one
2006 Apr 07
0
acts_as_taggable and tag list
Hi,
I''m using the new acts_as_taggable on Rails 1.1.1. I would like to get a list of all the tags for a particular model type, in my case "Post". I got it to work with:
Tag.find(:all,:include => :taggings, :conditions => "taggable_type=''Chunk''")
But I''m wondering if there''s a more Rubyish elegant way.
thanks, scott.
2007 Apr 23
1
Find related tags with acts_as_taggable
Using the acts_as_taggable plugin, how can I go about finding related
tags? ie specify a tag, find objects that have that tag, and then count
up its other tags and return say, the top 50 or something, in a method
something like Tag.find_related_tags(tag_object)
I think the gem has a method like this but the gem hasn''t been updated
if I''m not mistaken doesn''t use
2005 Dec 24
0
acts_as_taggable - adding users and normalizing tags
Hey all,
I''m wondering how people are using acts_as_taggable. Two things I''d
like to do that aren''t supported out of the box are tag normalization
and user attribution. I can''t imagine I''m the first to think about
doing this.
>From a schema perspective these things both seem simple, just put the
normalized tag in the tags table, and have a join
2006 May 21
2
acts_as_taggable and single table inheritance
I''ve set up a couple of STI models like such that we get something like
this...
class A < AR:Base
class B < A
acts_as_taggable
class C < A
acst_as_taggable
(using the acts_as_taggable plugin)
I can tag things just fine this way, the problem I encounter is that the
taggings are listed with the base class ("A") and not the appropriate
subclass ("B"
2006 Feb 17
1
acts_as_taggable plugin and multi word tags
I decided to play with the plugin acts_as_taggable based on Chad
Fowler''s book Rails Recipes. Is it just me or can tags only be one
word? If not can you explain to me how to assign multi-word tags
using the acts_as_taggable plugin.
Thanks :-)
John Kopanas
http://www.kopanas.com
=====================================================================
http://www.soen.info - source
2006 Jan 26
2
javascript in link_to?
having trouble finding how to include a random chunk of javascript (an
onclick event handler) in a link_to generated link.
at first i thought i could use the html_options field, but if i understand
correctly, that only supports :confirm, :popup, and :post options.
hope i''m wrong. anyone know different?
john
_______________________________________________
John McGrath
2005 Sep 03
13
acts_as_taggable v2 - Tagging on Steroids
Hi folks,
Thanks to the community feedback on the 1st version, I''ve come up with a
much improved version of the acts_as_taggable mixin.
ThereĀ“s some piece of the action here:
http://dema.ruby.com.br/articles/2005/09/03/tagging-on-steroids-with-rails
Cheers
Dema
--
http://dema.ruby.com.br - Rails from a .NET perspective