Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a new column to acts_as_taggable_on tag

Basically I would like to add the ability to vote on tags, so I would like to have a priority column for each different model's tag.

Any ideas about how to do this?

I suspect I need to make a new migration, but I don't know what to make it for. What would the migration be?

Thanks!

like image 334
bahudso Avatar asked Aug 08 '13 20:08

bahudso


1 Answers

As I remember, acts_as_taggable creates a table called tags, so you add a field to that table:

rails g migration add_votes_to_tag votes:integer

and add your logic to vote on tag.

P.S. Not sure if I understood correctly your question.

like image 50
rmagnum2002 Avatar answered Sep 25 '22 14:09

rmagnum2002