examples/blog/src/controller.rb in nitro-0.16.0 vs examples/blog/src/controller.rb in nitro-0.17.0
- old
+ new
@@ -1,9 +1,5 @@
-# * George Moschovitis <gm@navel.gr>
-# (c) 2005 Navel, all rights reserved.
-# $Id: controller.rb 20 2005-04-15 15:18:36Z gmosx $
-
require 'nitro/controller'
require 'nitro/ui/pager'
require 'nitro/localization'
require 'mailer'
@@ -32,10 +28,10 @@
@template_root = 'src/views'
def list_entry
@pager = UI::Pager.new('entries', request, 3)
- @entries = BlogEntry.all("ORDER BY oid DESC #{@pager.sql_limit}")
+ @entries = BlogEntry.all(:order => 'oid DESC', :extra => @pager.sql_limit)
@pager.set(BlogEntry.count)
end
def new_entry
entry = request.fill(BlogEntry.new)