Skip to content

Instantly share code, notes, and snippets.

@HungYuHei
Created October 22, 2012 23:58
Show Gist options
  • Save HungYuHei/3935656 to your computer and use it in GitHub Desktop.
Save HungYuHei/3935656 to your computer and use it in GitHub Desktop.
compile asset
# config/environments/production.rb
def compile_asset?(path)
if File.basename(path) =~ /^[^_].*\.\w+$/
puts "Compiling: #{path}"
true
else
puts "Ignoring: #{path}"
false
end
end
APP_NAME::Application.configure do
...
config.assets.precompile = [method(:compile_asset?).to_proc]
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment