Permalink
Browse files

Added watched lists index page

  • Loading branch information...
1 parent 532e89a commit f677c9f43dd0965145d4b29e4d673b41f3098c5b @rondy committed Nov 29, 2011
@@ -1,5 +1,9 @@
class WatchedListsController < ApplicationController
+ def index
+ @watched_lists = current_user.watched_lists
+ end
+
def create
@todo_list = TodoList.public_visibility.find(params[:todo_list_id])
@@ -0,0 +1,15 @@
+<div class="todo_list">
+ <div>
+ <%= watched_list.name %> <%= toggle_watching watched_list %>
+ </div>
+
+ <% unless watched_list.tasks.empty? %>
+ <ul class="tasks">
+ <% watched_list.tasks.each do |task| %>
+ <li><%= task.name %></li>
+ <% end %>
+ </ul>
+ <% end %>
+</div>
+
+<hr/>
@@ -0,0 +1,5 @@
+<h1>Watched lists</h1>
+
+<div id="todo_lists">
+ <%= render :partial => "watched_list", :collection => @watched_lists %>
+</div>

0 comments on commit f677c9f

Please sign in to comment.