phlexing
phlexing copied to clipboard
Support erb partial paramater comments
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
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.