Class: CitizenBudgetModel::SectionsController
Instance Method Summary
collapse
#admin?, #check_authorization!, #set_locale, #simulators, #users
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 17
def create
@section = collection.new(section_params)
if @section.save
redirect_to [@simulator, @section], notice: _('Section was created.')
else
render :new
end
end
|
#destroy ⇒ Object
35
36
37
38
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 35
def destroy
@section.destroy
redirect_to @simulator, notice: _('Section was deleted.')
end
|
#edit ⇒ Object
14
15
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 14
def edit
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 10
def new
@section = collection.new
end
|
#show ⇒ Object
7
8
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 7
def show
end
|
#sort ⇒ Object
40
41
42
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 40
def sort
super(@section.questions)
end
|
#update ⇒ Object
27
28
29
30
31
32
33
|
# File 'app/controllers/citizen_budget_model/sections_controller.rb', line 27
def update
if @section.update(section_params)
redirect_to [@simulator, @section], notice: _('Section was updated.')
else
render :edit
end
end
|