A Ruby template language that separates HTML structure from Ruby logic using presenter classes.
Curly is a template language for Ruby on Rails that completely separates HTML structure from Ruby logic by moving all presentation logic to presenter classes. It replaces `.erb` files with `.curly` templates, where components like `{{author}}` map to methods in a presenter, ensuring templates remain clean and logic is testable.
Ruby on Rails developers building maintainable web applications who want to avoid mixing Ruby code with HTML in templates. It's particularly useful for teams prioritizing clean separation of concerns in their view layer.
Developers choose Curly for its strict separation of structure and logic, which leads to more maintainable and testable templates compared to traditional ERB. Its presenter-based approach reduces template complexity and integrates seamlessly with Rails conventions.
The Curly template language allows separating your logic from the structure of your HTML templates.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enforces clean templates by moving all Ruby logic to presenter classes, making HTML declarative and logic unit-testable, as shown in the README's example of moving methods like `author_link` to a presenter.
Seamlessly integrates with Rails helpers, layouts, content blocks, and RSpec testing, allowing use of methods like `link_to` and `content_for` within presenters without extra setup.
Supports advanced features like identifiers for hierarchical data (e.g., `{{i18n.homepage.header}}`), attributes for parameterized components, and context blocks for inline widget templates, enabling complex rendering scenarios.
Provides dynamic and static caching at the presenter level with methods like `cache_key` and `version`, simplifying cache expiration and integration with Rails' caching mechanisms.
The project is officially no longer updated by Zendesk, with version 4.0.0 as the final release, posing risks for security, compatibility with future Rails versions, and lack of bug fixes.
Requires creating a separate presenter class for every template or partial, which can add boilerplate and complexity for simple views compared to ERB's inline Ruby snippets.
Has a smaller community and fewer third-party extensions compared to ERB or Haml, making it harder to find tutorials, plugins, or support for edge cases.
Introduces a custom syntax (e.g., `{{*comments}}` for collections, `{{@component}}` for context blocks) that developers must learn, unlike ERB's more familiar Ruby-embedded approach.