Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/generators/squeezer/templates/app/controllers/application_controller.rb

Overview

Filters added to this controller apply to all controllers in the application. Likewise, all the methods added will be available for all controllers.

Instance Method Summary collapse

Instance Method Details

#latestsObject



12
13
14
# File 'lib/generators/squeezer/templates/app/controllers/application_controller.rb', line 12

def latests
  Blog.paginate :page =>1,:per_page=>5, :order => 'created_at DESC'
end

#siteObject



16
17
18
# File 'lib/generators/squeezer/templates/app/controllers/application_controller.rb', line 16

def site
  return Site.last
end