lib/whitehall/govspeak_renderer.rb
def helpers
      @helpers ||= begin
        request = ActionDispatch::Request.new @env
        request.routes = controller._routes

        instance = controller.new
        instance.set_request!(request)
        instance.set_response!(controller.make_response!(request))
        instance.helpers
      end
    end
# We can't use `render` directly as `block_attachments` needs
# to return an array so construct a helpers proxy that allows
# us to call the govspeak helpers directly. This implementation
# mirrors that of `render` but we return the helpers proxy
# instead of rendering a template.
We can't use `render` directly as `block_attachments` needs
to return an array so construct a helpers proxy that allows
us to call the govspeak helpers directly. This implementation
mirrors that of `render` but we return the helpers proxy
instead of rendering a template.
We can ' t use ` render ` directly as ` block_attachments ` needs to return an array so construct a helpers proxy that allows us to call the govspeak helpers directly . This implementation mirrors that of ` render ` but we return the helpers proxy instead of rendering a template .
def helpers
      @helpers ||= begin
        request = ActionDispatch::Request.new @env
        request.routes = controller._routes
        instance = controller.new
        instance.set_request!(request)
        instance.set_response!(controller.make_response!(request))
        instance.helpers
      end
    end
def helpers @helpers ||= begin request = ActionDispatch :: Request . new @env request . routes = controller . _routes instance = controller . new instance . set_request! ( request ) instance . set_response! ( controller . make_response! ( request ) ) instance . helpers end end
We can't use `render` directly as `block_attachments` needs
to return an array so construct a helpers proxy that allows
us to call the govspeak helpers directly.
We can ' t use ` render ` directly as ` block_attachments ` needs to return an array so construct a helpers proxy that allows us to call the govspeak helpers directly .