Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@jasoncodes jasoncodes authored
View
13 lib/postmarkdown/railtie.rb
@@ -1,11 +1,14 @@
module Postmarkdown
class Railtie < Rails::Railtie
initializer :before_initialize do
- require 'rack'
- Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
- :urls => ['/stylesheets/postmarkdown'],
- :root => "#{postmarkdown_root}/public"
- )
+ unless Rails.application.config.respond_to?(:assets) && Rails.application.config.assets.enabled
+ puts 'hai'
+ require 'rack'
+ Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
+ :urls => ['/stylesheets/postmarkdown'],
+ :root => "#{postmarkdown_root}/vendor/assets"
+ )
+ end
ActionController::Base.append_view_path("#{postmarkdown_root}/app/views")
end
View
0  ...stylesheets/postmarkdown/postmarkdown.css → ...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.