Sha256: 35d0e4949e897527c2ffaa1be471f1b12280d53d3291f922ac9142b339d2e4f6
Contents?: true
Size: 1.61 KB
Versions: 11
Compression:
Stored size: 1.61 KB
Contents
## ExpressTemplates - Reusable view components in Ruby ### Write templates in Ruby Use a declarative style of Ruby to write template code based on [Arbre](https://github.com/aelogica/arbre). ```ruby content_for :title, "Hello, world" div { h1 "#{hello}" p 'Find me in app/views/hello/show.html.et' } ``` [Learn more](https://github.com/aelogica/express-gems/wiki/Express-Templates-HOWTO) ### Use Rails' form tag helpers ```ruby form(action: invites_path, method: "POST") { div(class: 'form-group') { label_tag(:invite_code, "Invite Code:") text_field_tag('invite_code', '', class: 'form-control') } } ``` ### Compose templates to build components Components are reusable pieces of user interface code. See [Express UI](https://github.com/express-gems/tree/master/express_ui). ```ruby class PageHeader < ExpressTemplates::Components::Base contains -> { if content_for?(:page_header) h1 { content_for(:page_header) } end if content_for?(:page_header_lead) para(class: 'lead') { content_for(:page_header_lead) } end } end ``` [Learn more](https://example.com) ### Philosophy 1. It's just Ruby. 2. Write less markup code with reusable components. [Learn more](https://example.com) ### Download and installation Download the latest version of ExpressTemplates from RubyGems: ``` $ gem install express_templates ``` Source code is on GitHub as part of the express-gems project: * https://github.com/aelogica/express-gems/tree/master/express_templates ### License ExpressTemplates is released under the MIT license: * http://www.opensource.org/licenses/MIT
Version data entries
11 entries across 11 versions & 1 rubygems