16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/rad/controller/_abstract/render.rb', line 16
def render *args
options = rad.template.parse_arguments *args
instance_variables = {
controller_name: self.class.controller_name
}
instance_variable_names.each do |name|
instance_variables[name[1..-1]] = instance_variable_get name unless name =~ /^@_/
end
instance_variables[:action_name] = options[:action] if options[:action]
context = self.class.context_class.new(instance_variables, self)
options.reverse_merge! \
context: context,
format: params.format,
exact_format: true,
relative_path_resolver: self.class
content = render_content options
content = render_layout content, options
throw :halt, content
end
|