X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f9baf5f392370318966c9392e3badbbd715592ad..220ad0a6b6a8154692a404c443402252dd361168:/app/controllers/diary_entry_controller.rb diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 7c77fc177..afa2722a1 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -1,2 +1,20 @@ class DiaryEntryController < ApplicationController + layout 'site' + + before_filter :authorize_web, :only => [:new] + before_filter :require_user, :only => [:new] + + def new + if params[:diary_entry] + @entry = DiaryEntry.new(@params[:diary_entry]) + @entry.user = @user + if @entry.save + redirect_to :controller => 'user', :action => 'diary', :display_name => @user.display_name + end + end + end + + def list + @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20) + end end