Class: HelenaAdministration::QuestionGroupsController
Instance Method Summary
collapse
#add_breadcrumb, #authenticate_administrator, #set_locale
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 17
def create
@question_group = @version.question_groups.build question_group_params
if @question_group.save
flash[:success] = t 'shared.actions.created'
else
flash.now[:danger] = t 'shared.actions.error'
end
respond_with [@survey, @version, @question_group]
end
|
#destroy ⇒ Object
41
42
43
44
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 41
def destroy
flash[:success] = t 'shared.actions.deleted' if @question_group.destroy
respond_with @question_group, location: [@survey, @version]
end
|
#edit ⇒ Object
27
28
29
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 27
def edit
add_breadcrumb @question_group.title
end
|
#new ⇒ Object
12
13
14
15
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 12
def new
@question_group = @version.question_groups.build
add_breadcrumb t('.new')
end
|
#show ⇒ Object
8
9
10
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 8
def show
add_breadcrumb @question_group.title
end
|
#update ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/helena_administration/question_groups_controller.rb', line 31
def update
if @question_group.update_attributes(question_group_params)
flash[:success] = t 'shared.actions.updated'
else
flash.now[:danger] = t 'shared.actions.error'
add_breadcrumb @question_group.title_was
end
respond_with [@survey, @version, @question_group]
end
|