Class: Kaminari::Helpers::TemplateWrapper
- Inherits:
-
Object
- Object
- Kaminari::Helpers::TemplateWrapper
- Defined in:
- lib/kaminari/helpers/helpers.rb
Overview
Wraps the template context and helps each tag render itselves
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(template, options) ⇒ TemplateWrapper
constructor
:nodoc:.
-
#partial_exists?(name) ⇒ Boolean
:nodoc:.
Constructor Details
#initialize(template, options) ⇒ TemplateWrapper
:nodoc:
10 11 12 13 |
# File 'lib/kaminari/helpers/helpers.rb', line 10 def initialize(template, ) #:nodoc: @template, @options = template, @params = [:params] ? template.params.merge(.delete :params) : template.params end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/kaminari/helpers/helpers.rb', line 7 def @options end |
#params ⇒ Object (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:
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 |