Module: TintedTags

Defined in:
lib/tinted_tags.rb,
lib/tinted_tags/engine.rb,
lib/tinted_tags/version.rb,
lib/tinted_tags/tag_tinter.rb,
lib/view_helpers/view_helpers.rb,
app/helpers/tinted_tags/application_helper.rb,
app/controllers/tinted_tags/application_controller.rb,
lib/generators/tinted_tags/migration/migration_generator.rb

Defined Under Namespace

Modules: ApplicationHelper, ViewHelpers Classes: ApplicationController, Engine, MigrationGenerator, TagTinter

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#tinted_tags(opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tinted_tags.rb', line 7

def tinted_tags(opts={})
  class_attribute :opts
  self.opts = opts

  class_eval do

    attr_accessible :tag_list
    after_save :update_tints, if: :tag_list_changed?

    private

    def update_tints
      TagTinter.new(self.class, opts).update_tints
    end
  end
end