tracks/tracks/app/controllers/feed_controller.rb
bsag d7b1c6e167 Having problems committing.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@9 a4c988fc-2ded-0310-b66e-134b36920a42
2005-01-22 15:43:39 +00:00

34 lines
1,006 B
Ruby

# Produces an feeds of the next actions, both RSS and plain text
#
class FeedController < ApplicationController
helper :feed
model :todo, :context, :project
before_filter :login_required
def index
end
# Builds an RSS feed for the latest 15 items
# This is fairly basic: it lists the action description as the title
# and the item context as the description
#
def na_feed
@not_done = Todo.find_all( "done=0", "created DESC" )
@headers["Content-Type"] = "text/xml; charset=utf-8"
end
# Builds a plain text page listing all the next actions,
# sorted by context. Showing notes doesn' make much sense here
# so they are omitted. You can use this with GeekTool to get your next actions
# on the desktop:
# curl http://url_for_the_app/feed/na_text
#
def na_text
@places = Context.find_all
@projects = Project.find_all
@not_done = Todo.find_all( "done=0", "context_id ASC" )
@headers["Content-Type"] = "text/plain; charset=utf-8"
end
end