1 class DiaryEntryController < ApplicationController
4 before_filter :authorize_web
5 before_filter :require_user, :only => [:new]
8 @title = 'new diary entry'
9 if params[:diary_entry]
10 @entry = DiaryEntry.new(params[:diary_entry])
13 redirect_to :controller => 'user', :action => 'diary', :display_name => @user.display_name
19 @title = 'recent diary entries'
20 @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20)
24 @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20)
26 rss = OSM::GeoRSS.new('OpenStreetMap diary entries', 'Recent diary entries from users of OpenStreetMap', 'http://www.openstreetmap.org/diary')
28 @entries.each do |entry|
32 rss.add(latitude, longitude, entry.title, url_for({:controller => 'user', :action => 'diary', :id => entry.id, :display_name => entry.user.display_name}), entry.body, entry.created_at)
35 response.headers["Content-Type"] = 'application/rss+xml'
37 render :text => rss.to_s