Skip to content

Instantly share code, notes, and snippets.

@kris
Created August 25, 2009 22:49
Show Gist options
  • Save kris/175098 to your computer and use it in GitHub Desktop.
Save kris/175098 to your computer and use it in GitHub Desktop.
class Admin::PagesController < InheritedResources::Base
actions :all
def update
update! do |success, failure|
failure.html { redirect_to root_url }
end
end
protected
def resource
@page ||= end_of_association_chain.find_by_permalink(params[:id])
end
def collection
@pages ||= end_of_association_chain.paginate(:page => params[:page])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment