Project

tagfiles

0.0
No release in over 3 years
Low commit activity in last 3 years
Provides the tagfile helper for Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

Tagfiles

Travis Gem Version Code Climate Test Coverage Inline docs

Gem | Source | Documentation

Tagfiles provides the tagfile helper for Rails.

Installation

Add this line to your application's Gemfile:

gem 'tagfiles'

And then execute:

$ bundle

Basic Usage

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.

Lookup order

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

Rails support

Following Rails versions are supported:

  • 6.0
  • 5.2
  • 4.2

Feel free to test earlier Rails versions. Feedback is welcome!

Ruby support

Ruby versions from 2.4.9 to 2.7.0 are supported.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request