How to set a background image in rails from css? -


i using rails 3.2 , have set background 1 of page , have tried many ways , nothing went right, looking help. have tried

background: url(<%= asset_path 'background.jpg' %>)  background: url("public/background.jpg");  background-image:url('/assets/images/background.jpg') 

and nothing worked. please me.

in css:

background-image: url(background.jpg); 

or

background-image: url(/assets/background.jpg); 

in environments/production.rb:

# disable rails's static asset server (apache or nginx this)   config.serve_static_assets = false  # compress javascripts , css   config.assets.compress = true  # don't fallback assets pipeline if precompiled asset missed   config.assets.compile = false  # generate digests assets urls   config.assets.digest = true 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -