Scss.erb ruby ​​code not executing

I am trying to load a background image that is stored in Rackspace CloudFiles in my stylesheet file. I used Fog and CarrierWave to load the image file and to call the file. I keep getting this error:

Invalid CSS after "... und-image: url (": expected ")", was "<% = design.main ..."

preview.css.scss.erb:

html{ background-image: url(<%= design.main_image_url.to_s %>); } 

Update: I rephrase my question and I got an answer from here

I should have asked: "How do I pass an instance variable into assets?" - which you cannot

+2
ruby-on-rails sass ruby-on-rails-3
source share
1 answer

Put the URL in quotation marks.

 url('<%= design.main_image_url.to_s %>'); 
0
source share

All Articles