title: changing background-image using ruby
body: <p>I wanted to change my background using ruby, but the background is  white</p>
  
  <pre><code>body {
    background: url(&lt;%= asset_path'#{@imagefond}'%&gt;) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
  }
  </code></pre>
  
  <p>in my <code>fils.rb</code>, I put,</p>
  
  <pre><code>def background_acceuil
    i=0
    t=['fond.jpg','fond1.jpg']
    while i&lt;t.length
      @imagefond=t[i]
      sleep 3
      i=i+1
      if i==t.length
      i=0
    end
  end
  </code></pre>