Skip to content

Instantly share code, notes, and snippets.

@taea
Last active December 19, 2015 11:19
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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