Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
Only show todos based on filter url
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 29, 2013
1 parent 0960865 commit be8f5f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/views/todo_view.rb
Expand Up @@ -32,7 +32,13 @@ def initialize(todo)
end

def apply_filter(filter)
puts "need to apply #{filter} for #{@todo}"
element.toggle_class :hidden, hidden?(filter)
end

def hidden?(filter)
completed = @todo.completed

!completed && filter == 'completed' or completed && filter == 'active'
end

def clear
Expand Down

0 comments on commit be8f5f9

Please sign in to comment.