1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
module ActionView module TemplateHandlers class RJS < TemplateHandler include Compilable self.default_format = Mime::JS def compile(template) "@formats = [:html];" + "controller.response.content_type ||= Mime::JS;" + "update_page do |page|;#{template.source}\nend" end def default_format Mime::JS end end end end