Module: Deface::ActionViewExtensions

Defined in:
lib/deface/action_view_extensions.rb

Defined Under Namespace

Modules: DefacedTemplate, ErubiHandlerFix

Class Method Summary collapse

Class Method Details

.determine_syntax(handler) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/deface/action_view_extensions.rb', line 2

def self.determine_syntax(handler)
  return unless Rails.application.config.deface.enabled

  if handler.to_s == "Haml::Plugin"
    :haml
  elsif handler.class.to_s == "Slim::RailsTemplate"
    :slim
  elsif handler.to_s.demodulize == "ERB" || handler.class.to_s.demodulize == "ERB"
    :erb
  else
    nil
  end
end