Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: c0110a9faa
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (24 sloc) 0.689 kB
module ActionView
module TemplateHandlers
class RJS < TemplateHandler
include Compilable
def self.line_offset
2
end
def compile(template)
"controller.response.content_type ||= Mime::JS\n" +
"update_page do |page|\n#{template}\nend"
end
def cache_fragment(block, name = {}, options = nil) #:nodoc:
@view.fragment_for(block, name, options) do
begin
debug_mode, ActionView::Base.debug_rjs = ActionView::Base.debug_rjs, false
eval('page.to_s', block.binding)
ensure
ActionView::Base.debug_rjs = debug_mode
end
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.