title: how to add embedded ruby in style tag
body: <p>I want to define the width of a status bar dynamically.</p>
  
  <p>First I define the variable:</p>
  
  <pre><code>&lt;% target = (clicks/total_clicks)*100 %&gt;
  </code></pre>
  
  <p>Then I try to embed the ruby code into a css width tag:</p>
  
  <pre><code>&lt;div class="bar" style="width: &lt;%= target %&gt;%"&gt;
  </code></pre>
  
  <p>However, the html output looks like this</p>
  
  <pre><code>&lt;div class="progress progress-striped"&gt;
  &lt;div class="bar" style="width: 0%"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried to convert the target var as a string:</p>
  
  <pre><code>&lt;% target = ((clicks/total_clicks)*100).to_s %&gt;
  </code></pre>
  
  <p>I obviously also tried to assign a not-dynamic value as well:</p>
  
  <pre><code>&lt;% target = 40.to_s %&gt;
  </code></pre>
  
  <p>But with no success.</p>
  
  <p>How can I embed a ruby var into a CSS style tag?
  Thanks for any help.</p>