title: What's the cleanest way to add a class attribute to an html element in a view in rails
body: <p>I'm writing some Rails code for a partial view, and I want it to only show a comment field if somebody is already logged onto a site here.</p>
  
  <p>If the page is viewed by someone who isn't a member of the site yet, the <code>shared/comment_not_logged_in</code> fragment should be passed in.</p>
  
  <p>However, I'm totally stumped as to why I can't run the same check to decide if the page should add the class attribute "missing_your_voice" to the enclosing div element here:</p>
  
  <pre><code>   &lt;li class="user_submission_form bubble comment_form &lt;% "missing_your_voice" if not current_user %&gt;"&gt;
  
        &lt;% if current_user %&gt;      
          &lt;%= image_tag(current_user.avatar(:comment), :class =&gt; "profile_pic") %&gt;
          &lt;% form_for [parent, Comment.new] do |f| %&gt;
          &lt;%= render "comments/form", :f =&gt; f %&gt;
          &lt;% end %&gt;
        &lt;% else %&gt;
          &lt;%= render :partial =&gt; 'shared/comment_not_logged_in' %&gt;
        &lt;% end %&gt;
  
    &lt;/li&gt;  
  </code></pre>
  
  <p>The same idiom, <code>"missing_your_voice" if not current_user</code> returns the string in irb, and also in the console debugger.</p>
  
  <p>What am I doing wrong here?</p>