Here is the my application details:
work environment:windows instantrails2.0
1.i have created a controller and a model for 'aticle' and 'announcements'.
2.i added acts_as_taggable in both the models(i.e article.rb and announcement.rb)
3.i created a migration for tag support like add_tag_support.rb which contains the two tables ,names 'tags' and 'taggings'
class AddTagSupport < ActiveRecord::Migration def self.up # Table for your Tags create_table :tags do |t| t.column :name, :string end
create_table :taggings do |t| t.column :tag_id, :integer # id of tagged object t.column :taggable_id, :integer # type of object tagged t.column :taggable_type, :string end end
def self.down drop_table :tags drop_table :taggings end
4.i created a migration for the two table article and announcements for tag support like:
class AddArticlesAddAnnouncements < ActiveRecord::Migration def self.up create_table :articles do |t| t.column :name, :string t.column :body, :string t.column :created_on, :date t.column :updated_on, :date end create_table :announcements do |t| t.column :body, :string t.column :created_on, :date t.column :updated_on, :date end end
def self.down drop_table :articles drop_table :announcements end end
4.then i did rake db:migrate
5.if i login to http://localhost:3000/articles or http://localhost:3000/announcements
am able to enter the data into both tables
6 then i enter to console window
Artical.tag_with('xxxx')
if i do the above command im getting error like method is not defined
article = Article.find(1)
is working
article.tag_list
is giving empty array like =>
below are my quires:
1)can anyone help out me in this issue how to tag the tables and is there any changes do i need to change. 2)i try to instal steroids like: ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids its giving like no plugin found so i downloaded and just copied in to vendor/plugins/acts_as_taggable_on_steroids and started working .is it wrong? 3)where we need to do the changes in controller and views to search for perticular tag from the two models for user interface?
thanks