8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/settings_controller.rb', line 8
def update_all
success = false
if params[:settings_section].present?
section = params[:settings_section].to_s
if section.eql? "notifications"
if params[:notify_by_email].present?
notify_by_email = params[:notify_by_email].to_s
current_subject.notify_by_email = false if notify_by_email.eql? "never"
current_subject.notify_by_email = true if notify_by_email.eql? "always"
end
end
success = current_subject.save
end
if success
flash[:success] = t('settings.success')
else
flash[:error] = t('settings.error')
end
render :action => :index
end
|