# How to implement tags using acts\_as\_taggable\_on\_steroids?

**URL:** <https://www.ruby-forum.com/t/how-to-implement-tags-using-acts-as-taggable-on-steroids/154852>\
**Category:** Rails\
**Created:** [December 4, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/how-to-implement-tags-using-acts-as-taggable-on-steroids/154852 "2008-12-04T13:47:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [December 4, 2008, 1:47pm UTC](https://www.ruby-forum.com/t/how-to-implement-tags-using-acts-as-taggable-on-steroids/154852/1 "2008-12-04T13:47:34Z")

</div>

hi all:

im using rails 2.0 on windows:  
i instaled acts\_as\_taggable\_on\_steroids  
i have a controller and a model for streams table.  
i did migration for tag support also

everything is working fine i.e if i run

[http://localhost:3000/streams](http://localhost:3000/streams)

i am able to enter the data in to streams table from web index page.

on ruby console i have tried like:

I have faced below problems like:

> if I want to find the data from table with tag name xx I m getting the  
> same result for all other tags also.(my table contains columns  
> like:name,resolution,framerate,codecname and tags table having the tags  
> as:resolution,name,codecname,omap,hd)

Example:  
Stream.find\_tagged\_with(‘resolution’)  
=\> [#\<Stream id: 4, name: “mummy.mpeg2”, resolution: “352x240”,  
codecname: “mpeg2”, framerate: “30fps”, created\_at: “2008-12-04  
16:25:41”, updated\_at: “2008-12-04 16:48:47”\>]

> > Stream.find\_tagged\_with(‘codecname’)  
> > =\>[#\<Stream id: 4, name: “mummy.mpeg2”, resolution: “352x240”,  
> > codecname: “mpeg2”, framerate: “30fps”, created\_at: “2008-12-04  
> > 16:25:41”, updated\_at: “2008-12-04 16:48:47”\>]

Below are the details of my table entries :

mysql\> use stdb\_development;  
Database changed  
mysql\> show tables;  
±---------------------------+  
| Tables\_in\_stdb\_development |  
±---------------------------+  
| schema\_info |  
| streams |  
| taggings |  
| tags |  
±---------------------------+  
4 rows in set (0.00 sec)

mysql\> select \* from tags;  
±—±-----------+  
| id | name |  
±—±-----------+  
| 1 | codecname |  
| 2 | resolution |  
| 3 | omap |  
| 4 | hd |  
| 5 | omap hd |  
| 6 | omap,hd |  
±—±-----------+  
6 rows in set (0.00 sec)

mysql\> select \* from taggings;  
±—±-------±------------±--------------+  
| id | tag\_id | taggable\_id | taggable\_type |  
±—±-------±------------±--------------+  
| 1 | 1 | 4 | Stream |  
| 2 | 2 | 4 | Stream |  
| 3 | 3 | 4 | Stream |  
| 4 | 4 | 4 | Stream |  
| 5 | 5 | 4 | Stream |  
| 6 | 6 | 4 | Stream |  
±—±-------±------------±--------------+  
6 rows in set (0.00 sec)

mysql\> select \* from streams;  
±—±------------------±-----------±----------±----------  
±--------------------±--------------------+  
| id | name | resolution | codecname | framerate |  
created\_at | updated\_at |  
±—±------------------±-----------±----------±----------  
±--------------------±--------------------+  
| 1 | dust.mpeg2 | 1920x1080 | mpeg2 | 30fps |  
2008-12-04 16:23:23 | 2008-12-04 16:23:23 |  
| 2 | amelie.264 | 720x480 | h264 | 25fps |  
2008-12-04 16:23:58 | 2008-12-04 16:23:58 |  
| 3 | davincieffect.aac | NA | aac | NA |  
2008-12-04 16:24:46 | 2008-12-04 16:24:46 |  
| 4 | mummy.mpeg2 | 352x240 | mpeg2 | 30fps |  
2008-12-04 16:25:41 | 2008-12-04 16:48:47 |  
±—±------------------±-----------±----------±----------  
±--------------------±--------------------+  
4 rows in set (0.00 sec)

1)so my doubt is tag name can be anything or it shoud be the one of  
the column name of the table?  
2)to do the same by accepting the tag name as text box entry and i  
need to find(search) the data of perticular tag.How can i proceed  
that?

any one can give me an idea whether i am doing the wrong or smthing  
else?

thanks
