Created
June 25, 2011 07:51
-
-
Save Amitesh/1046269 to your computer and use it in GitHub Desktop.
Set Rails Engine/Gem public assets path, to server it from Engine/Gem itself
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
require "rails" | |
module MyEngine | |
class Engine < Rails::Engine | |
# We can add all of the public assets from our engine and make them | |
# available to use. This allows us to use javascripts, images, stylesheets | |
# etc. | |
initializer "static assets" do |app| | |
app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment