Created
October 11, 2010 22:16
-
-
Save xenda/621324 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::PagesController < InheritedResources::Base | |
| layout "admin" | |
| before_filter :authenticate_admin! | |
| def default_path | |
| admin_pages_path | |
| end | |
| def create | |
| create! { default_path } | |
| end | |
| def update | |
| update! { default_path } | |
| end | |
| def collection | |
| @pages ||= end_of_association_chain.paginate :page => params[:page], :per_page => (params[:per_page] || 10), :order => "created_at DESC" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment