blob: 2e2fff44c606e70fef0e27259144a5206dc3e504 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
module ActionView
module Renderable
# TODO: Local assigns should not be tied to template instance
attr_accessor :locals
# TODO: These readers should be private
attr_reader :filename, :source, :handler
def render
prepare!
@handler.render(self)
end
def method
['_run', @extension, @method_segment].compact.join('_').to_sym
end
private
def prepare!
unless @prepared
@view.send(:evaluate_assigns)
@view.current_render_extension = @extension
if @handler.compilable?
@handler.compile_template(self) # compile the given template, if necessary
end
@prepared = true
end
end
end
end
|