From 1eba0609296c8208fd69062a189371c05ebce11e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 7 May 2010 14:08:25 +0100 Subject: [PATCH] Redirect after processing user changes After we have processed the requested user changes, redirect back to the list so that the resulting page is reloadable without getting resubmission warnings from the browser. --- app/controllers/user_controller.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 5b9f5a0c7..222840a06 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -339,16 +339,18 @@ class UserController < ApplicationController User.update_all("status = 'confirmed'", :id => ids) if params[:confirm] User.update_all("status = 'deleted'", :id => ids) if params[:hide] - end - - conditions = Hash.new - conditions[:status] = params[:status] if params[:status] - conditions[:creation_ip] = params[:ip] if params[:ip] - @user_pages, @users = paginate(:users, - :conditions => conditions, - :order => :id, - :per_page => 50) + redirect_to url_for(:status => params[:status], :ip => params[:ip], :page => params[:page]) + else + conditions = Hash.new + conditions[:status] = params[:status] if params[:status] + conditions[:creation_ip] = params[:ip] if params[:ip] + + @user_pages, @users = paginate(:users, + :conditions => conditions, + :order => :id, + :per_page => 50) + end end private -- 2.43.2