ECTjs Conditions

by arohy

HTML

<% if @links?.length : %>
  <ul>
    <!-- links -->
  </ul>
<% else : %>
  <p>List is empty</p>
<% end %>

<% switch @user.oauthProvider : %>
    <% when 'facebook' : %>
        <img src="facebook.png" />
    <% end %>
    <% when 'twitter' : %>
        <img src="twitter.png" />
    <% end %>
    <% else : %>
        <img src="other.png" />
    <% end %>
<% end %>