Add support for format as symbol (e.g. when specified in routes.rb or inside the controller

This commit is contained in:
Lloyd 2013-01-16 12:21:00 +09:00
parent b1ae9a4c58
commit 2d05060311

View File

@ -15,7 +15,7 @@ module RablRails
compiled_template = compile_template_from_source(source, path)
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
def compile_template_from_source(source, path = nil)