title: css.erb file in Sinatra
body: <p>Is it possible to have a css.erb file in Sinatra for serving images from AWS for example. I am pulling my static assets from AWS and can pull in an image in my view for example</p>
  
  <pre><code>&lt;%= image_tag( aws_asset "/assets/img/banner2.jpg") %&gt;
  </code></pre>
  
  <p>aws_asset is a helper that sets AWS url</p>
  
  <pre><code>helpers do
   def aws_asset( path )
   File.join settings.asset_host, path
   end
  end
  
  configure :development do 
   set :asset_host, "https://s3-eu-west-1.amazonaws.com/#{ENV['FOG_DIRECTORY']}" 
  end
  </code></pre>
  
  <p>so the question is how do i get a background image from  my css file to pull that image from AWS</p>
  
  <p>EDIT</p>
  
  <p>Current setup</p>
  
  <p>myapp.rb</p>
  
  <pre><code>get "/assets/css/style.css" do
  erb :style 
  end
  </code></pre>
  
  <p>layout.erb</p>
  
  <pre><code>&lt;%= stylesheet_link_tag  "/assets/css/style.css"  %&gt;
  </code></pre>
  
  <p>style.css</p>
  
  <pre><code>body {
  background: url('&lt;%= aws_asset "/assets/img/banner1.jpg" %&gt;');
  
  }
  </code></pre>
  
  <p>Thanks</p>