This gem provides a small helper and installation scripts to use custom elements in conjunction with importmap-rails
.
Add this line to your application's Gemfile:
gem "custom_elements-rails"
Install the gem:
$ bundle install
Run the initial setup:
$ rails custom_elements:install
This will setup and add the following files:
app/javascript
βββ application.js
βββ custom_elements
βββ hello_element.js
βββ index.js
You can now add the <app-hello>
custom element in your app. No build step needed.
TODO
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.