From 6268c0fd6db760a1f993d666eaf7c36c7e5565cc Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 1 Feb 2012 12:26:23 -0500 Subject: [PATCH] Hide up/down if not present --- app/views/habits/_habit.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/habits/_habit.html.erb b/app/views/habits/_habit.html.erb index fd82f60dc7..a9a76a0c15 100644 --- a/app/views/habits/_habit.html.erb +++ b/app/views/habits/_habit.html.erb @@ -15,8 +15,8 @@ <% if habit.habit_type==Habit::ALWAYS %> - <%= link_to "√", { :action => "vote", :id => habit.id, :vote => 'up' }, :remote=>true %> - <%= link_to "X", { :action => "vote", :id => habit.id, :vote => 'down' }, :remote=>true %> + <%= link_to("√", { :action => "vote", :id => habit.id, :vote => 'up' }, :remote=>true) if habit.up %> + <%= link_to("X", { :action => "vote", :id => habit.id, :vote => 'down' }, :remote=>true) if habit.down %> <%= raw name %> (<%= habit.score %>) <% elsif habit.habit_type==Habit::DAILY %> <% if habit.done %>