1 2 3 4 5 6 7 8 9 10 11 12 13 14
module ActionView module TemplateHandlers class RJS < TemplateHandler def self.line_offset 2 end def compile(template) "controller.response.content_type ||= Mime::JS\n" + "update_page do |page|\n#{template}\nend" end end end end