2011-10-30 23:02:41 +00:00
|
|
|
module Locomotive
|
2010-05-10 22:39:52 +00:00
|
|
|
class SnippetsController < BaseController
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-09-22 12:50:01 +00:00
|
|
|
sections 'settings', 'theme_assets'
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-13 20:01:40 +00:00
|
|
|
respond_to :json, :only => :update
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-11-28 14:40:25 +00:00
|
|
|
def new
|
|
|
|
@snippet = current_site.snippets.new
|
|
|
|
respond_with @snippet
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
@snippet = current_site.snippets.create(params[:snippet])
|
|
|
|
respond_with @snippet, :location => edit_snippet_url(@snippet)
|
|
|
|
end
|
|
|
|
|
|
|
|
def edit
|
|
|
|
@snippet = current_site.snippets.find(params[:id])
|
|
|
|
respond_with @snippet
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@snippet = current_site.snippets.find(params[:id])
|
|
|
|
@snippet.update_attributes(params[:id])
|
|
|
|
respond_with @snippet, :location => edit_snippet_url(@snippet)
|
|
|
|
end
|
|
|
|
|
2010-09-22 12:50:01 +00:00
|
|
|
def destroy
|
2011-11-28 14:40:25 +00:00
|
|
|
@snippet = current_site.snippets.find(params[:id])
|
|
|
|
@snippet.destroy
|
|
|
|
respond_with @snippet, :location => theme_assets_url
|
2010-05-10 22:39:52 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-10 22:39:52 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|