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.
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.
Right now, the div only appears if the user has accepted the invite.
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?)
<% if invite.accepted %>
<%= link_to(:controller => "invites", :action => "not_attending") do %>
<div class="not_attending_div">
not attending
</div>
<% end %>
<% end %>