Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

style defaults

branch: rails2

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 rails
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 flutie.gemspec
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb
README.textile

Flutie

Basic, default styles for rails applications

Installation

Flutie is a Rails engine. It works with versions of Rails greater than 2.3.

Flutie is recommended to be run as a plugin so that the automatic installer is run.

$ ruby script/plugin install -f git@github.com:thoughtbot/flutie.git -r rails2

The installer will copy the Flutie stylesheets into public/flutie/stylesheets

Once Flutie is installed, with your application running (not in production environment) you can browse to /styleguide. This will present you with many standard markup elements that are present in a Rails application, in your default application layout. Be sure to add the :flutie symbol (see below ‘Usage’) to your layout first.

Click on the “Default styles” link to view the same markup with a barebones layout that only contains the Flutie stylesheets. Click on “Application styles” to view the markup in your application layout.

Usage

Flutie registers a :flutie shortcut for stylesheets, so in your layout you can do…

<%= stylesheet_link_tag :flutie, 'admin', :cache => true %>

…this will include all the flutie stylesheets, then the ‘admin’ stylesheet, and it will cache them all into one file.

To add custom styles to the styleguide add partials to the app/views/styleguides directory. For example:

app/views/styleguides/_todo_item.erb:
<ol>
  <li class="todo">This is a todo item</li>
</ol>

Plugin authors can also add to the styleguide by ensuring that their view path
is in ActionController::Base.view_paths and by placing a partial under the
styleguides directory. For example:

ActionController::Base.append_view_path(File.join(File.dirname(__FILE__), 'views'))
my_awesome_plugin/views/styleguides/_pagination.erb:
<div class="pagination">
  <a href="#prev">Previous</a>
  <a href="#next">Next</a>
</div>

Gem Installation

You can also install Flutie as a gem, but then you’ll need to run the install task manually.

In config/environment.rb:

config.gem "thoughtbot-flutie", 
  :lib     => 'flutie', 
  :source  => 'http://gems.github.com', 
  :version => '1.0.0'

Vendor the gem:

rake gems:install
rake gems:unpack

Run the installer:

ruby vendor/gems/thoughtbot-flutie-1.0.0/install.rb

Authors

Flutie was written by thoughtbot, inc.

Suggestions, Bugs, Refactoring?

Fork away and create a Github Issue. Please don’t send pull requests.

Something went wrong with that request. Please try again.