View helpers for Rails applications
Flutie provides some utility view helpers for use with Rails applications.
There are helpers for setting a page title and for generating body classes.
Flutie is a Railtie. We support the versions of Ruby and Rails listed in .github/workflows/build.yml.
It should be run as a gem and included in your Gemfile:
gem "flutie"Flutie provides helper methods for use within Rails layouts and views.
The page_title method can be used like:
By default, it will produce results like:
Appname : page titleAppname::Application will produce "Appname"content_for(:page_title) and assumes you are using
content_for with :page_title symbol on your pages.These can be overridden by passing an options hash including :app_name,
:page_title_symbol and :separator hash keys. For example:
content_for(:site_page_title, 'My title of my page')
page_title(app_name: 'My app name', page_title_symbol: :site_page_title, separator: " | ")would produce:
My app name | My title of my pageYou can also reverse the position of the :app_name and the :site_page_title
values by using the :reverse option. For example:
content_for(:site_page_title, 'My title of my page')
page_title(app_name: 'My app name', page_title_symbol: :site_page_title, reverse: true)would produce:
My title of my page : My app nameThe body_class method can be used like this in a layout:
">This will produce a string including the controller name and controller-action
name pair. For example, The WidgetsController#show action would produce:
Anything which has been added via content_for(:extra_body_classes) will be
added to the end, for example views like:
content_for(:extra_body_classes, 'special-page')
">would produce:
See the CONTRIBUTING document. Thank you, contributors!
Flutie is maintained and funded by [thoughtbot, inc][thoughtbot].
Thank you to all the contributors!
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
Flutie is Copyright © 2010 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
This repo is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software! See our other projects. We are available for hire.
No open issues yet, or sync has not completed.