We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33dd91b commit 6fa5beaCopy full SHA for 6fa5bea
lib/gon.rb
@@ -44,7 +44,11 @@ def set_variable(name, value)
44
end
45
46
def rabl(view_path, options = {})
47
- rabl_data = Gon::Rabl.parse_rabl(view_path, @request_env['action_controller.instance'])
+ rabl_data = Gon::Rabl.parse_rabl(view_path, options[:controller] ||
48
+ @request_env['action_controller.instance'] ||
49
+ @request_env['action_controller.rescue.response'].
50
+ instance_variable_get('@template').
51
+ instance_variable_get('@controller'))
52
if options[:as]
53
set_variable(options[:as].to_s, rabl_data)
54
elsif rabl_data.is_a? Hash
0 commit comments