title: Conditional div with a variable in a rails view
body: <p>I have a rails view where I generate a div conditionally if a local variable is defined. Ideally, I would like to be able to do something like this:</p>
  
  <pre><code>&lt;%= '&lt;div class="search_wrapper_inner #{group_class}" &gt;'.html_safe if defined?(group_class) %&gt;
  </code></pre>
  
  <p>However, the string interpolation obviously fails because of the html_safe and produces the following...</p>
  
  <pre><code>&lt;div class= "search_wrapper_inner #{group_class}"&gt; 
  </code></pre>
  
  <p>how can I add a variable class to a conditionally generated div?</p>