funkensturm / acts_as_category

Think of acts_as_tree + acts_as_list, but doing what you want: root categories, subcategories, positions, individual inherited permissions and some script.aculo.us view helpers.

This URL has Read+Write access

acts_as_category / init.rb
100644 12 lines (8 sloc) 0.389 kb
1
2
3
4
5
6
7
8
9
10
11
12
plugin_path = File.dirname __FILE__
 
# Loading localization files
I18n.load_path += Dir[File.join(plugin_path, 'config', 'locale', '*.{rb,yml}')]
 
# Loading Helper
ActionView::Base.class_eval 'include ActsAsCategoryHelper'
 
# Loading acts_as_*
ActiveRecord::Base.class_eval 'include ActiveRecord::Acts::Category'
ActiveRecord::Base.class_eval 'include ActiveRecord::Acts::CategoryContent'