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

Support erb partial paramater comments #451

Open
rachelgraves opened this issue Nov 19, 2024 · 1 comment
Open

Support erb partial paramater comments #451

rachelgraves opened this issue Nov 19, 2024 · 1 comment

Comments

@rachelgraves
Copy link

Is your feature request related to a problem? Please describe.

When using a partial that includes paramaters in a comment, the initialize method is not generated with those paramaters.

i.e.

<%# locals: (question:, answer: nil, open: false) %>

Describe the solution you'd like

Produce an initializer, and include any defaults.

attr_reader :question, :answer, :open

def initialize(question:, answer: nil, open: false)
  @question = question
  @answer = answer
  @open = open
end
@marcoroth
Copy link
Owner

Thanks for reporting this one, @rachelgraves!

This is a good one and I guess it makes sense to support that when you are migrating single partials as independent Phlex components.

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

No branches or pull requests

2 participants