No commit activity in last 3 years
No release in over 3 years
acts_as_category
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

ActsAsCategory

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'acts_as_category'

And then execute:

$ bundle

Or install it yourself as:

$ gem install acts_as_category

Usage

rails generator model category
create_table :categories do |t|
  t.string :name
  t.string :model
  t.string :context
  t.references :resource, :polymorphic => true
  t.timestamps
end
class Category < ActiveRecord::Base
  attr_accessible :name
  acts_as_category
end

class Forum < ActiveRecord::Base
  attr_accessible :name
end

class Topic < ActiveRecord::Base
  attr_accessible :title
end
Category.used_for
Category.used_for('category')
Category.used_for(Topic)
Category.used_for(Topic, 'category')
Category.used_for(Topic, 'location')
Category.used_for(@forum)
Category.used_for(@forum, 'location')
Category.used_for(@forum, Topic)
Category.used_for(@forum, Topic, 'location')

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request