aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/rjs.rb
blob: 63e7dc0902752e5821a411435abb460e257c2c0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module ActionView
  module Template::Handlers
    class RJS < Template::Handler
      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