Sprockets require asset over HTTP

醉酒当歌 提交于 2019-12-14 02:25:35

问题


I would like to know if it's possible to require some assets over HTTP, eg:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the top of the
 * compiled file, but it's generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require 'http://assets.domain.com/stylesheets/style.css'
*/

I get a Sprockets::FileNotFound error with this snippet.

Thank you


回答1:


The Sprockets readme notes that require takes a path, and makes no reference to pulling things off HTTP.

The JurassicCoffee project for .NET appears to have added the ability to load files over HTTP.

Same question but with JS...



来源:https://stackoverflow.com/questions/20608119/sprockets-require-asset-over-http

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!