Class: CitizenBudgetModel::QuestionsController
Instance Method Summary
collapse
#admin?, #check_authorization!, #set_locale, #simulators, #sort, #users
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 18
def create
@question = collection.new(question_params)
if @question.save
redirect_to [@simulator, @section, @question], notice: _('Question was created.')
else
render :new
end
end
|
#destroy ⇒ Object
36
37
38
39
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 36
def destroy
@question.destroy
redirect_to [@simulator, @section], notice: _('Question was deleted.')
end
|
#edit ⇒ Object
15
16
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 15
def edit
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 11
def new
@question = collection.new
end
|
#show ⇒ Object
8
9
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 8
def show
end
|
#update ⇒ Object
28
29
30
31
32
33
34
|
# File 'app/controllers/citizen_budget_model/questions_controller.rb', line 28
def update
if @question.update(question_params)
redirect_to [@simulator, @section, @question], notice: _('Question was updated.')
else
render :edit
end
end
|