phlexing
phlexing copied to clipboard
Methods called within the ERB template are not generated in the component output
ERB Input:
<% if some_condition? %>
<%= "Text" %>
<% end %>
Output:
class Component < Phlex::HTML
def template
if some_condition?
text "Text"
end
end
end
Expected output:
class Component < Phlex::HTML
def template
if some_condition?
text "Text"
end
end
private
# TODO: Implement the `some_condition?` method
def some_condition?
super
end
end
This might be unnecessary since we’ll get a helpful NoMethodError anyway when calling method? anyway.
I thought it might be cool to indicate that there's still something missing.
But I updated the example to use super so that we still would get the helpful exception.