Created
January 14, 2013 11:24
-
-
Save morhekil/4529455 to your computer and use it in GitHub Desktop.
How to integrate Zurb Foundation with Rails 2.3 project. Requires a backport of asset pipeline to Rails 2.
http://foundation.zurb.com/
https://github.com/grosser/rails2_asset_pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'zurb-foundation' | |
rescue MissingSourceFile | |
# doing a rescue here as Zurb is Rails3-oriented, and so it will try to load | |
# Rails 3 style generators, etc. We don't need that, we only need the | |
# frameworks and includes | |
end | |
# Add all registered frameworks to Sass's load path to make them available | |
# through @imports | |
Compass::Frameworks::ALL.each do |fw| | |
Sass.load_paths << fw.stylesheets_directory | |
end | |
# Define custom asset path helper, that Sprockets want for some reason | |
Rails2AssetPipeline.env.context_class.class_eval do | |
def asset_path(path, options = {}) | |
"/assets/#{path}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment