phlexing icon indicating copy to clipboard operation
phlexing copied to clipboard

Support erb partial paramater comments

Open rachelgraves opened this issue 1 year ago • 1 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

rachelgraves avatar Nov 19 '24 14:11 rachelgraves

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.

marcoroth avatar Nov 19 '24 15:11 marcoroth