Class: Admin::SnippetsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/snippets_controller.rb

Instance Method Summary collapse

Instance Method Details

#create_draftObject



5
6
7
8
# File 'app/controllers/admin/snippets_controller.rb', line 5

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

#expire_cacheObject



10
11
12
# File 'app/controllers/admin/snippets_controller.rb', line 10

def expire_cache
  Rails.cache.delete('snippets')
end