aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/user_controller.rb2
-rw-r--r--app/views/user/_change_receive_email.rhtml2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index ef013ad1e..e56c4dd33 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -588,7 +588,7 @@ class UserController < ApplicationController
end
@user.receive_email_alerts = params[:receive_email_alerts]
@user.save!
- redirect_to request.headers['HTTP_REFERER']
+ redirect_to params[:came_from]
end
private
diff --git a/app/views/user/_change_receive_email.rhtml b/app/views/user/_change_receive_email.rhtml
index 78d847038..83e5d8601 100644
--- a/app/views/user/_change_receive_email.rhtml
+++ b/app/views/user/_change_receive_email.rhtml
@@ -3,10 +3,12 @@
<% if @user.receive_email_alerts %>
<%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %><br><br>
<%= hidden_field_tag 'receive_email_alerts', 'false' %>
+ <%= hidden_field_tag 'came_from', request.url %>
<%= submit_tag _("Turn off email alerts") %>
<% else %>
<%= _('Items matching the following conditions are currently displayed on your wall.') %><br><br>
<%= hidden_field_tag 'receive_email_alerts', 'true' %>
+ <%= hidden_field_tag 'came_from', request.url %>
<%= submit_tag _("Also send me alerts by email") %>
<% end %>
</div>