title: Making a conditional link_to statement in Rails?
body: <p>In the code below, I'm trying to make it so that, if a user has accepted an invite, they'll be able to click on the "not attending" div to decline the invite.</p>
  
  <p>That bit of logic works fine, but I'm trying to get it so the "not attending" div shows up regardless of whether the user has accepted the invite. </p>
  
  <p>Right now, the div only appears if the user has accepted the invite.</p>
  
  <p>Is there a way to make the link_to statement conditional, but preserve the div regardless? (That is, make it so the div is always present, but is only a link if the user's accepted the invite?)</p>
  
  <pre><code>&lt;% if invite.accepted %&gt;
      &lt;%= link_to(:controller =&gt; "invites", :action =&gt; "not_attending") do %&gt;                             
          &lt;div class="not_attending_div"&gt;
               not attending
          &lt;/div&gt;
      &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>