Skip to content

undefined method `raw_buffer' for an instance of ActionView::OutputBuffer #305

Open
@stereobooster

Description

@stereobooster

I'm trying to add Phlex to existing project. I'm not sure which step I miss. I did this:

bundle add phlex-rails
bundle exec rails generate phlex:install

Then I added file (app/components/my_component.rb)

class MyComponent < Phlex::HTML
  def initialize(name:)
    @name = name
  end

  def view_template
    h1 { "Hello, #{@name}" }
  end
end

Then in app/views/layouts/application.html.erb

<%= render MyComponent.new(name: "Hello") %>

And I get this error:

undefined method `raw_buffer' for an instance of ActionView::OutputBuffer

Any suggestions how to deal with it? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions