title: HAML add href if
body: <p>Rails 4 + HAML.</p>
  
  <p>Is there any way to consolidate this into one line?</p>
  
  <pre><code>- if current_page?(controller: 'root', action: 'sign_up')
      %a Sign Up
  - else
      %a{href: program_sign_up_path} Sign Up
  </code></pre>
  
  <p>The reason is that if the link has an href, it appears to still be clickable and reloads the page on click, whereas if the user is on the sign_up page, the link either shouldn't be clickable or not go anywhere. An href with an empty string didn't do the job, but getting rid of the href altogether seems to work.</p>