Class: Locomotive::SnippetsController
Instance Method Summary
collapse
#require_ssl
#current_site_public_url, #public_page_url, #switch_to_site_url
#sections
#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks
Instance Method Details
#create ⇒ Object
22
23
24
25
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 22
def create
@snippet = current_site.snippets.create(params[:snippet])
respond_with @snippet, location: edit_snippet_path(@snippet._id)
end
|
#destroy ⇒ Object
38
39
40
41
42
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 38
def destroy
@snippet = current_site.snippets.find(params[:id])
@snippet.destroy
respond_with @snippet, location: theme_assets_path
end
|
#edit ⇒ Object
27
28
29
30
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 27
def edit
@snippet = current_site.snippets.find(params[:id])
respond_with @snippet
end
|
#new ⇒ Object
12
13
14
15
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 12
def new
@snippet = current_site.snippets.new
respond_with @snippet
end
|
#show ⇒ Object
17
18
19
20
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 17
def show
@snippet = current_site.snippets.find(params[:id])
respond_with @snippet
end
|
#update ⇒ Object
32
33
34
35
36
|
# File 'app/controllers/locomotive/snippets_controller.rb', line 32
def update
@snippet = current_site.snippets.find(params[:id])
@snippet.update_attributes(params[:snippet])
respond_with @snippet, location: edit_snippet_path(@snippet._id)
end
|