class RailsRenderService::RendererPatch

Public Instance Methods

render(context, options) click to toggle source
# File lib/rails_render_service/renderer_patch.rb, line 5
def render(context, options)
  @view    = context
  @details = extract_details(options)
  template = determine_template(options)

  prepend_formats(template.formats)

  @lookup_context.rendered_format ||= (template.formats.first || formats.first)

  locals = (options[:locals] || {}).reverse_merge(
    virtual_path: template.try(:virtual_path),
  )
  render_template(template, options[:layout], locals)
end