Sha256: c10b9092166abcb71ace5e4f0e6013ec1885487222aa95251a89753da7a2f786
Contents?: true
Size: 583 Bytes
Versions: 7
Compression:
Stored size: 583 Bytes
Contents
# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base protect_from_forgery layout 'application' helper_method :site helper_method :latests def latests Blog.paginate :page =>1,:per_page=>5, :order => 'created_at DESC' end def site return Site.last end rescue_from CanCan::AccessDenied do |exception| flash[:error] = "Acceso no permitido!" redirect_to root_url end end
Version data entries
7 entries across 7 versions & 1 rubygems