Hacker News new | ask | show | jobs
by sudhirj 1758 days ago
I've been using view_components for a while, and there's no going back for me. Much easier to organise views and keep them modular and easy to change and reuse. Only thing I haven't figured out yet is refactoring, how to organise a large number of views into folders / modules without having to move tons of files manually or script it.

Tailwind is pretty useful as well, but definitely needs a component system like this, or an application of the Atomic Design principles to not have to repeat your styles hundreds of times all over the place.

1 comments

Are you using the sidecar setup?
Nope. Does the sidecar create a folder for each component?
Yep. It's "experimental" but stable. It creates the .rb file at the root and then you can put the template, CSS & JS in a subfolder.

`bin/rails g component Button --sidecar`