Background image is not uploaded in my view page.showing this error.
ActionController::RoutingError (No route matches [GET] "/assets/images/control_top.png")
what can i do to resolve this problem?
In production env, Rails will not be responsible for serving static assets. Therefore, you are getting this error.
This is controlled by this setting in config/environment/production.rb in your application:
config.serve_static_assets = false
You can set to that true
or try this
rake assets:precompile
command (compiles and copies images, css and js from app/assets to public/.
If you upgrade to a new version of Rails (Rails 4 and Rails 3.2.16 come to mind), and you suddenly start to see this error, it is likely that your stylesheet is pointing to the non-fingerprinted, non-cached version of the files. If you are using the asset pipeline, in order to take advantage of it, you need to use the new helpers that point to the fingerprinted, cached version of the files. To do so, you'll need to either embed erb in your css file, or use sass.
Incorrect (uses sass):
.class
background: url('asset.png') no-repeat
Correct (uses sass):
.class
background: image-url('asset.png') no-repeat
For more info, see here: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
Might help someone , i tried all the answers and forgot the most basic thing to do . Clearing the browser cache , once done i was good to go :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With