Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Serve stylesheet using Rails 3.1 asset pipeline.

The asset pipeline will serve assets out of gems automatically if
they are in the gem's vendor/assets/ directory.

For compatibility with Rails 3.0 we use Rack middleware
to serve the assets if the asset pipeline is unavailable.
  • Loading branch information...
commit eafba9662221c8946855edea2bc5ea874c62e525 1 parent 3969436
Jason Weathered jasoncodes authored
13 lib/postmarkdown/railtie.rb
... ... @@ -1,11 +1,14 @@
1 1 module Postmarkdown
2 2 class Railtie < Rails::Railtie
3 3 initializer :before_initialize do
4   - require 'rack'
5   - Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
6   - :urls => ['/stylesheets/postmarkdown'],
7   - :root => "#{postmarkdown_root}/public"
8   - )
  4 + unless Rails.application.config.respond_to?(:assets) && Rails.application.config.assets.enabled
  5 + puts 'hai'
  6 + require 'rack'
  7 + Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
  8 + :urls => ['/stylesheets/postmarkdown'],
  9 + :root => "#{postmarkdown_root}/vendor/assets"
  10 + )
  11 + end
9 12 ActionController::Base.append_view_path("#{postmarkdown_root}/app/views")
10 13 end
11 14
0  public/stylesheets/postmarkdown/postmarkdown.css → .../assets/stylesheets/postmarkdown/postmarkdown.css
File renamed without changes

0 comments on commit eafba96

Please sign in to comment.
Something went wrong with that request. Please try again.