How to set a background image in rails from css?
问题 I am using rails 3.2 and i have to set a background for one of the page and i have tried many ways and nothing went right, so looking for some good help. I have tried background: url(<%= asset_path 'background.jpg' %>) background: url("public/background.jpg"); background-image:url('/assets/images/background.jpg') and nothing worked. Please help me. 回答1: In your CSS: background-image: url(background.jpg); or background-image: url(/assets/background.jpg); In environments/production.rb : #