Sha256: ee3fb652597bf5d0ac1a531fb85594267265d26a1e6d923c98c958ec6a2da520

Contents?: true

Size: 680 Bytes

Versions: 6

Compression:

Stored size: 680 Bytes

Contents

# This helper is a module that will get included into Rails via the
# lib/navi/railtie class
#
# It allows us to be in the context of the controller it is being included
# into: when this module is included to ActionView and the view/controller
# calls the render method, "self" will refer to the view or controller
# context
module Navi
  module Helpers
    # Don't declare @renderer in here, or else it won't play nicely with Rails.

    def self.included(base)
      #puts "Navi::Helpers was included into #{base}"
    end

    def navi_render(collection, *args)
      @navi_renderer ||= Navi.renderer.new(self)
      @navi_renderer.render(collection, *args)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
navi-0.2.1 lib/navi/helpers.rb
navi-0.2.0 lib/navi/helpers.rb
navi-0.1.4 lib/navi/helpers.rb
navi-0.1.3 lib/navi/helpers.rb
navi-0.0.17 lib/navi/helpers.rb
navi-0.0.16 lib/navi/helpers.rb