Skip to content

Instantly share code, notes, and snippets.

@taea
Last active December 19, 2015 11:19
Show Gist options
  • Save taea/5946682 to your computer and use it in GitHub Desktop.
Save taea/5946682 to your computer and use it in GitHub Desktop.
if ○○だった時だけ classをつける
%span.count-num{ class: "#{'unread' if hoge_count > 0}" }<>= link_to hoge_count, hoge_path
@fukajun
Copy link

fukajun commented Jun 10, 2014

これ、条件に当てはまらない時 <span class></span> になりますね。(好みの問題?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment