Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

flutie

> 编程语言
Open source

View helpers for Rails applications

731 stars0 likes1 views
WebsiteGitHub

About

View helpers for Rails applications

Flutie

Flutie Build Status Gem Version

Flutie provides some utility view helpers for use with Rails applications.

There are helpers for setting a page title and for generating body classes.

Installation & Upgrading

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:

ruby
gem "flutie"

Helpers

Flutie provides helper methods for use within Rails layouts and views.

Page Title

The page_title method can be used like:

erb

By default, it will produce results like:

xml
Appname : page title
  • "App name" comes from the module name of the rails application created by your app, i.e. Appname::Application will produce "Appname"
  • "page" comes from trying content_for(:page_title) and assumes you are using content_for with :page_title symbol on your pages.
  • The separator defaults to " : "

These can be overridden by passing an options hash including :app_name, :page_title_symbol and :separator hash keys. For example:

ruby
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:

xml
My app name | My title of my page

You can also reverse the position of the :app_name and the :site_page_title values by using the :reverse option. For example:

ruby
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:

xml
My title of my page : My app name

Body Class

The body_class method can be used like this in a layout:

erb
">

This will produce a string including the controller name and controller-action name pair. For example, The WidgetsController#show action would produce:

xml

Anything which has been added via content_for(:extra_body_classes) will be added to the end, for example views like:

erb
content_for(:extra_body_classes, 'special-page')
">

would produce:

xml

Contributing

See the CONTRIBUTING document. Thank you, contributors!

Credits

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.

License

Flutie is Copyright © 2010 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About thoughtbot

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.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言