Sprockets 無副檔名報錯的 workaround

把以下這段丟到 application.rb 裡

config.assets.precompile.shift
config.assets.precompile.push(Proc.new do |path|
  File.extname(path).in? [
    '.html', '.erb', '.haml',                 # Templates

    '.png',  '.gif', '.jpg', '.jpeg', '.svg', # Images

    '.eot',  '.otf', '.svc', '.woff', '.ttf', # Fonts

  ]
end)

Comments

comments powered by Disqus