]> git.openstreetmap.org Git - rails.git/blob - app/controllers/diary_entry_controller.rb
Change server_settings to smtp_settings to avoid deprecation warning.
[rails.git] / app / controllers / diary_entry_controller.rb
1 class DiaryEntryController < ApplicationController
2   layout 'site'
3   
4   before_filter :authorize_web
5   before_filter :require_user, :only => [:new]
6
7   def new
8     if params[:diary_entry]     
9       @entry = DiaryEntry.new(params[:diary_entry])
10       @entry.user = @user
11       if @entry.save 
12         redirect_to :controller => 'user', :action => 'diary', :display_name => @user.display_name 
13       end
14     end
15   end
16   
17   def list
18     @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20)
19   end
20 end