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) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/haml_coffee_assets/action_view/resolver.rb', line 10

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