Sha256: af2fd4ae2f52c3a6e738b398e837f6641db393dae2e75c5678dd6ff93898986b

Contents?: true

Size: 432 Bytes

Versions: 1

Compression:

Stored size: 432 Bytes

Contents

module Crumbs
  class Controller

    def initialize(controller)
      @controller = controller
    end

    def action(action, name=nil, &block)
      controller = @controller.to_s
      action = action.to_s
      name = (block_given? ? block : name)
      all = Crumbs.all
      if all.has_key? controller
        all[controller][action] = name
      else
        all[controller] = { action => name }
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crumbs-2.0.2 lib/crumbs/controller.rb