Class: HamlCoffeeAssets::ActionView::Resolver

Inherits:
ActionView::FileSystemResolver
  • Object
show all
Defined in:
lib/haml_coffee_assets/action_view/resolver.rb

Overview

Custom resolver to prevent Haml Coffee templates from being rendered by Rails for non-HTML formats, since a template name without a MIME type in it would normally be a fallback for all formats.

Instance Method Summary collapse

Instance Method Details

#find_templates(name, prefix, partial, details, outside_app_allowed = false) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/haml_coffee_assets/action_view/resolver.rb', line 11

def find_templates(name, prefix, partial, details, outside_app_allowed = false)
  if details[:formats].include?(:html)
    clear_cache if ::Rails.env == "development"
    if ::Rails::VERSION::STRING < "4.2.5.1"
      super(name, prefix, partial, details)
    else
      super(name, prefix, partial, details, outside_app_allowed)
    end
  else
    []
  end
end