Module: RenderPartialWithPrefixes::MonkeyPatch

Defined in:
lib/render_partial_with_prefixes/monkeypatch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
# File 'lib/render_partial_with_prefixes/monkeypatch.rb', line 4

def self.included(base)
  base.class_eval do
    alias_method_chain :find_template, :prefixes
  end
end

Instance Method Details

#find_template_with_prefixes(path, locals) ⇒ Object



10
11
12
13
# File 'lib/render_partial_with_prefixes/monkeypatch.rb', line 10

def find_template_with_prefixes(path, locals)
  prefixes = path.include?(?/) ? [] : (@options[:prefixes] || @lookup_context.prefixes)
  @lookup_context.find_template(path, prefixes, true, locals, @details)
end