Permalink
Browse files

add docs about stylesheet expansion, and change to copy instead of init

  • Loading branch information...
1 parent e58578a commit 9c014b949137884b5b85a7cf7be0219816b62868 @mjankowski mjankowski committed Jul 28, 2009
Showing with 22 additions and 11 deletions.
  1. +8 −0 README.textile
  2. +9 −0 config/flutie_expansion.rb
  3. +0 −10 init.rb
  4. +4 −0 install.rb
  5. +1 −1 test/test_helper.rb
View
@@ -16,6 +16,14 @@ Once Flutie is installed, with your application running (not in production envir
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.
+h2. 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.
+
h2. Gem Installation
You can also install Flutie as a gem, but then you'll need to run the install task manually.
@@ -0,0 +1,9 @@
+ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :flutie => [
+ '/flutie/stylesheets/reset',
+ '/flutie/stylesheets/defaults',
+ '/flutie/stylesheets/type',
+ '/flutie/stylesheets/forms',
+ '/flutie/stylesheets/tables',
+ '/flutie/stylesheets/lists',
+ '/flutie/stylesheets/screen'
+]
View
10 init.rb
@@ -1,11 +1 @@
require 'flutie'
-
-ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :flutie => [
- '/flutie/stylesheets/reset',
- '/flutie/stylesheets/defaults',
- '/flutie/stylesheets/type',
- '/flutie/stylesheets/forms',
- '/flutie/stylesheets/tables',
- '/flutie/stylesheets/lists',
- '/flutie/stylesheets/screen'
-]
View
@@ -12,4 +12,8 @@ def copy_files(source_path, destination_path, directory)
directory = File.dirname(__FILE__)
+# Copy the flutie stylesheets into rails_root/public/flutie
copy_files("/public/stylesheets", "/public/flutie", directory)
+
+# Copy the stylesheet expansion into rails_root/config/initializers
+copy_files("/config/flutie_expansion.rb", "/config/initializers", directory)
View
@@ -6,7 +6,7 @@
require 'action_controller'
require 'test_help'
require 'flutie'
-require 'init'
+require 'config/flutie_expansion'
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'app', 'controllers')

0 comments on commit 9c014b9

Please sign in to comment.