Created
April 13, 2011 12:36
-
-
Save littlemove/917457 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Admin::WadusController < ApplicationController | |
| before_filter :require_admin | |
| layout "admin" | |
| inherit_resources | |
| respond_to :html | |
| back_section :contents | |
| protected | |
| def collection | |
| # Las funciones get_collection_ivar son de inherited_resources. | |
| # Lo que hace es, dependiendo del controlador: | |
| # @pages ||= end_of_association_chain.... | |
| # ó @html_items ||= end_of_association_chain.... | |
| get_collection_ivar || set_collection_ivar(end_of_association_chain.paginate(:page => params[:page], :per_page => 20, :order => 'created_at DESC')) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment