Class: Kaminari::Helpers::TemplateWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/kaminari/helpers/helpers.rb

Overview

Wraps the template context and helps each tag render itselves

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, options) ⇒ TemplateWrapper

:nodoc:



10
11
12
13
# File 'lib/kaminari/helpers/helpers.rb', line 10

def initialize(template, options) #:nodoc:
  @template, @options = template, options
  @params = options[:params] ? template.params.merge(options.delete :params) : template.params
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/kaminari/helpers/helpers.rb', line 7

def options
  @options
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/kaminari/helpers/helpers.rb', line 7

def params
  @params
end

Instance Method Details

#partial_exists?(name) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/kaminari/helpers/helpers.rb', line 15

def partial_exists?(name) #:nodoc:
  resolver = context.instance_variable_get('@view_paths').first
  resolver.find_all(*args_for_lookup(name)).present?
end