search for: with_format

Displaying 1 result from an estimated 1 matches for "with_format".

Did you mean: math_format
2010 Jul 04
2
Rendering a different format in the implementation of a renderer
...t there are legitimate reasons for wanting to override it. For instance, implementing one renderer in terms of another. In my particular case, I''m trying to get HTML rendered in order to convert it to PDF. As I can see no other clean way, I wish ActionView::LookupContext had a method #with_format(format) { ... } for overriding the format for the duration of the block. Such a renderer could then look like this ActionController.add_renderer(:xyz) do |template, options| lookup_context.with_format(:html) do html = render(template, options) convert_html_to_xyz(html) end...