Class: Tuning::Extensions::ActionView::Handlers::Ruby

Inherits:
Object
  • Object
show all
Defined in:
lib/tuning/extensions/action_view/handlers.rb

Instance Method Summary collapse

Instance Method Details

#call(template) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tuning/extensions/action_view/handlers.rb', line 9

def call(template)
  if template.type.json?
    "      output = begin\n        \#{template.source}\n      end\n      output.to_json\n    STRING\n  else\n    template.source\n  end\nend\n"