Class: Backend::SnippetsController
Instance Method Summary
collapse
#update_translation
#breadcrumb, #current_admin, #default_app_locale, #translate_notice
#crypt
Instance Method Details
#create ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/backend/snippets_controller.rb', line 15
def create
@model = Snippet.new allowed_params
if @model.save
redirect_to edit_translation_backend_snippet_path(@model, translation_locale: default_app_locale),
notice: translate_notice(:added, :snippet)
else
render :new
end
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/backend/snippets_controller.rb', line 7
def index
@snippets = Snippet.order(:description)
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/backend/snippets_controller.rb', line 11
def new
@model = Snippet.new
end
|
#update ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'app/controllers/backend/snippets_controller.rb', line 26
def update
if @model.update_attributes allowed_params
redirect_to edit_backend_snippet_path(@model),
notice: translate_notice(:edited, :snippet)
else
render :edit
end
end
|