Skip to content

Commit

Permalink
Merge pull request cmaujean#2 from alexshuhin/remove_rc
Browse files Browse the repository at this point in the history
Removed deprecated resource_controller
  • Loading branch information
cmaujean committed Jul 6, 2011
2 parents 05d50ff + 4ceab20 commit 938c0cb
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions app/controllers/admin/snippets_controller.rb
@@ -1,25 +1,13 @@
class Admin::SnippetsController < Admin::BaseController
resource_controller
class Admin::SnippetsController < Admin::ResourceController
update.after :expire_cache
create.after :expire_cache

def create_draft
@snippet = Snippet.create!
redirect_to edit_admin_snippet_url(@snippet.id)
end

update.response do |wants|
wants.html { redirect_to collection_url }
end

update.after do
Rails.cache.delete('snippets')
end

create.response do |wants|
wants.html { redirect_to collection_url }
end

create.after do
def expire_cache
Rails.cache.delete('snippets')
end

end

0 comments on commit 938c0cb

Please sign in to comment.