aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/rjs.rb
blob: b1d15dc209c21f3d3a82c9956111b0a22dc2aa1f (plain) (tree)
1
2
3
4
5
6
7
8
9


                               

                        

                                    
                           
                                                          
                                                         
         



                        


       
module ActionView
  module TemplateHandlers
    class RJS < TemplateHandler
      include Compilable

      self.default_format = Mime::JS

      def compile(template)
        "controller.response.content_type ||= Mime::JS;" +
          "update_page do |page|;#{template.source}\nend"
      end

      def default_format
        Mime::JS
      end
    end
  end
end