lib/gon/rabl.rb in gon-5.2.3 vs lib/gon/rabl.rb in gon-6.0.0

- old
+ new

@@ -18,12 +18,12 @@ if global && !options[:template] raise 'You should provide :template when use rabl with global variables' end data = parse_rabl \ - Gon::Base.get_template_path(options, 'rabl'), - Gon::Base.get_controller(options), + Gon::EnvFinder.template_path(options, 'rabl'), + Gon::EnvFinder.controller_env(options), options[:locals] [data, options] end @@ -51,10 +51,10 @@ def parse_with_rabl_rails(rabl_path, controller, locals) locals ||= {} source = File.read(rabl_path) original_formats = controller.formats controller.formats = [:json] - view_context = controller.view_context + view_context = controller.send(:view_context) locals.each { |k, v| view_context.assigns[k.to_s] = v } output = RablRails::Library.instance.get_rendered_template(source, view_context) controller.formats = original_formats JSON.parse(output) end