Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankie-loves-jesus/9290064 to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/9290064 to your computer and use it in GitHub Desktop.

Images not working in Rails 4 -- Ruby brackets still in #main after bundle exec rake assets:precompile RAILS_ENV=production according to Chrome dev tools.

test.css.erb

#main { background-image: url(<%= asset_path 'main.png' %>); }

application.html.erb

<%= stylesheet_link_tag "test", :media => "all" %>

application.rb

config.assets.enabled = true
config.assets.precompile += ["test.css.erb"]
config.assets.version = "1.0"

production.rb

config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :yui
config.assets.compile = false
config.assets.digest = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment