#viewcomponents

2022-12-20

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

2022-10-31

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?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst