DEV Community

Discussion on: Advanced ViewComponent patterns in Rails

Collapse
abeidahmed profile image
Abeid Ahmed Author

Yes, because SubheadComponent class does not have the call method defined. When you're passing in a block, Ruby looks for a call method.
Instead of defining call method for each of the components, you can simplify define in your top level class and refer that class.