Skip to content

Instantly share code, notes, and snippets.

@tkfm-yamaguchi
Created June 27, 2014 13:44
Show Gist options
  • Save tkfm-yamaguchi/e9b8cd23ab34a1fd9b83 to your computer and use it in GitHub Desktop.
Save tkfm-yamaguchi/e9b8cd23ab34a1fd9b83 to your computer and use it in GitHub Desktop.
# config/initializers/sprockets.rb
YourAppName::Application.configure do |config|
config.assets.context_class.instance_eval do
# enables to use named_route in the asset files.
# ( asset file should be ERB )
include Rails.application.routes.url_helpers
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment