layout |
---|
home |
rails.style is a curated resource hub for Rails developers. It currently focuses on UI related libraries, and will expand to cover other topics (background jobs, administration, mailers, newsletters, etc.) in the future.
Early Rails applications use ERB (or others like Haml) partials and bloated helpers. Modern Rails projects often emphasizes encapsulation and component-based design. There's a few libraries to create reusable and testable UI components.
Encapsulation | Templating | Output | Performance* | |
---|---|---|---|---|
ERB Partial | Bad | Template | HTML | 3 |
ViewComponent | Not Bad | Ruby Class + Template | HTML | 6 |
Cells | Not Bad | Ruby Class + Template | HTML | 2 |
Hanami::View | Not Bad | Ruby Class + Template | HTML, JSON, XML | - |
Phlex | Not Bad | Pure Ruby | HTML (more planned) | 8 |
Papercraft | Not Bad | Pure Ruby | HTML, JSON, XML | 9 |
* performance data source: view-layer-benchmarks
{% include rails_ui.html %}
-
{% for post in site.data.posts %}
- {{ post.title | escape }} {% endfor %}