Delightful Reveal #4

A weekly update on all things Flagrant

In the process of migrating from #ViewComponents to #Phlex. Have forked phlex-rails to add anything missing, which works well so far. My first opportunity to contribute to #OSS

What’s your opinion on #ViewComponents in Rails?

We recently had a discussion on our internal Engineers Basecamp. We had some PRs and inconsistency between using `def call` or having a view partial for each component. Pros and cons for both.

I settled on: if you can imagine the ViewComponent being a utility view helper that’s part of Rails – eg: `button_to` – use `call`.

If it’s anything else, especially something a designer would need to work on. Use a partial.

Thoughts?