ElementComponent
Build html
Installation
Add this line to your application's Gemfile:
gem 'element_component'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install element_component
Usage
maker = El::Maker.new
form = maker.form(attribute: { class: 'has-background-color', method: 'GET', action: '/', turbo: false }) do |form|
input = maker.input(attribute: { type: 'text', name: 'email', value: nil })
form.add_content input
button = maker.button(content: 'Save', attribute: { type: 'submit'})
div = maker.div(content: button, attribute: { class: 'buttons' })
form.add_content div
end
puts form.build