new
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1 (0)
- 5.1.7 (1)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (38)
- 7.1.3.4 (0)
- What's this?
new(controller, env, defaults)
public
Parameters
-
controller - The controller class to instantiate for rendering.
-
env - The Rack env to use for mocking a request when rendering. Entries can be typical Rack env keys and values, or they can be any of the following, which will be converted appropriately:
-
:http_host - The HTTP host for the incoming request. Converts to Rack’s HTTP_HOST.
-
:https - Boolean indicating whether the incoming request uses HTTPS. Converts to Rack’s HTTPS.
-
:method - The HTTP method for the incoming request, case-insensitive. Converts to Rack’s REQUEST_METHOD.
-
:script_name - The portion of the incoming request’s URL path that corresponds to the application. Converts to Rack’s SCRIPT_NAME.
-
:input - The input stream. Converts to Rack’s rack.input.
-
-
defaults - Default values for the Rack env. Entries are specified in the same format as env. env will be merged on top of these values. defaults will be retained when calling #new on a renderer instance.
If no http_host is specified, the env HTTP host will be derived from the routes’ default_url_options. In this case, the https boolean and the script_name will also be derived from default_url_options if they were not specified. Additionally, the https boolean will fall back to Rails.application.config.force_ssl if default_url_options does not specify a protocol.