]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Validate passwords properly when creating an account. Fixes #419.
[rails.git] / app / controllers / diary_entry_controller.rb
index c25c8718dced4fab126fea2f8a3e8494146fd01d..f8e2a5761d58575189b74c36b72af987ea44ef9c 100644 (file)
@@ -2,15 +2,19 @@ class DiaryEntryController < ApplicationController
   layout 'site'
   
   before_filter :authorize_web
-  before_filter :require_user
+  before_filter :require_user, :only => [:new]
 
   def new
     if params[:diary_entry]     
-      @entry = DiaryEntry.new(@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