Add support for format as symbol (e.g. when specified in routes.rb or inside the controller
This commit is contained in:
parent
b1ae9a4c58
commit
2d05060311
@ -15,7 +15,7 @@ module RablRails
|
|||||||
compiled_template = compile_template_from_source(source, path)
|
compiled_template = compile_template_from_source(source, path)
|
||||||
|
|
||||||
format = context.params[:format] || 'json'
|
format = context.params[:format] || 'json'
|
||||||
Renderers.const_get(format.upcase!).new(context, locals).render(compiled_template)
|
Renderers.const_get(format.to_s.upcase!).new(context, locals).render(compiled_template)
|
||||||
end
|
end
|
||||||
|
|
||||||
def compile_template_from_source(source, path = nil)
|
def compile_template_from_source(source, path = nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user