Jim Remsik · @jremsikjr
389 followers · 523 posts · Server ruby.social
Michael Loistl · @michaelloistl
17 followers · 100 posts · Server ruby.social

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

#ViewComponents #phlex #oss

Last updated 2 years ago

michiels · @michiels
75 followers · 115 posts · Server ruby.social

What’s your opinion on 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?

#ViewComponents

Last updated 2 years ago