Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when rendering blocks #235

Open
stephannv opened this issue Oct 15, 2024 · 0 comments · May be fixed by #236
Open

Problem when rendering blocks #235

stephannv opened this issue Oct 15, 2024 · 0 comments · May be fixed by #236
Milestone

Comments

@stephannv
Copy link
Contributor

The yield_content was removed here in favor of render. But using render with blocks is breaking with ArgumentError: 'nil' is not an ActiveModel-compatible object. It must implement #to_partial_path..

To reproduce the error:

class Hello < Phlex::HTML
  def view_template(&)
    plain "Hello "
    render(&)
  end
end

Hello.new.call { "World" }

# or rendering inside another component

class Page < Phlex::HTML
  def view_template
    render Hello.new do
      span { "World" }
    end
  end
end

I will open a PR with a failing test.

@stephannv stephannv changed the title Problem rendering blocks Problem when rendering blocks Oct 15, 2024
@joeldrapper joeldrapper added this to the 2.0 milestone Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants