Skip to content

Instantly share code, notes, and snippets.

@xenda
Created October 11, 2010 22:16
Show Gist options
  • Select an option

  • Save xenda/621324 to your computer and use it in GitHub Desktop.

Select an option

Save xenda/621324 to your computer and use it in GitHub Desktop.
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