Gem | Source | Documentation
Tagfiles provides the tagfile
helper for Rails.
Add this line to your application's Gemfile:
gem 'tagfiles'
And then execute:
$ bundle
Tagfile: app/views/tagfiles/_box.html.haml
.box
%h2= title
%p= yield
HAML file using box
tagfile: app/views/admin/page/index.html.haml
= tf :box, title: "Box title"
Some box content
See examples/ and specs for more examples.
Rendering the box
tagfile from the example above will trigger with following lookups:
app/views/admin/page/tagfiles/_box.html.erb
app/views/admin/tagfiles/_box.html.erb
app/views/tagfiles/_box.html.erb
Following Rails versions are supported:
- 6.0
- 5.2
- 4.2
Feel free to test earlier Rails versions. Feedback is welcome!
Ruby versions from 2.4.9 to 2.7.0 are supported.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request