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

Allow rendering nil #251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

stephannv
Copy link
Contributor

@stephannv stephannv commented Dec 21, 2024

Rendering nil on Phlex::Rails is raising an error because the code is reaching this line.

Running this code with Phlex results in an empty string:

Phlex::HTML.new.call do |c|
  c.render nil
end

# => ""

Running the same code with Phlex::Rails raises an error:
EDIT: Now with the correct error

Phlex::HTML.new.call do |c|
  c.render nil
end

# ArgumentError ('nil' is not an ActiveModel-compatible object. It must implement #to_partial_path.):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant