Skip to content

Can not use "request" as argument  #2111

Closed
@erikaxel

Description

@erikaxel

Steps to reproduce

Having request as a argument to a component fails, eg

class ExampleComponent < ViewComponent::Base
  def initialize(request:)
    @request = request
  end
end

Running render(ExampleComponent.new(request: "My Title"))
will result in:

private method `format' called for an instance of String

A repo with the error is at https://github.com/erikaxel/view_component-request-bug-replica

System configuration

Using request worked before version 3.15, my assumption is that #2079 is the culprit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions