Sha256: a0225f796152e6539b969311f94f0d717e9cc54b45b03a5db12254983801f0e9

Contents?: true

Size: 384 Bytes

Versions: 2

Compression:

Stored size: 384 Bytes

Contents

module MenuBuilder
  module Controller
    extend ActiveSupport::Concern

    def menu_item(name, options = {})
      instance_variable_set('@menu_item', name)
    end

    module ClassMethods
      def menu_item(name, options = {})
        before_filter(options) do |controller|
          controller.instance_variable_set('@menu_item', name)
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
menu_builder-0.3.3 lib/menu_builder/controller.rb
menu_builder-0.3.2 lib/menu_builder/controller.rb