Replaced all custom back_url redirection with Redmine's redirect_back_or_default. #1916
This commit is contained in:
@@ -58,13 +58,7 @@ class RatesController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @rate.save
|
if @rate.save
|
||||||
flash[:notice] = 'Rate was successfully created.'
|
flash[:notice] = 'Rate was successfully created.'
|
||||||
format.html {
|
format.html { redirect_back_or_default(rates_url(:user_id => @rate.user_id)) }
|
||||||
if @back_url
|
|
||||||
redirect_to(@back_url)
|
|
||||||
else
|
|
||||||
redirect_to(rates_url(:user_id => @rate.user_id))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
format.xml { render :xml => @rate, :status => :created, :location => @rate }
|
format.xml { render :xml => @rate, :status => :created, :location => @rate }
|
||||||
else
|
else
|
||||||
format.html { render :action => "new" }
|
format.html { render :action => "new" }
|
||||||
@@ -82,13 +76,7 @@ class RatesController < ApplicationController
|
|||||||
# Locked rates will fail saving here.
|
# Locked rates will fail saving here.
|
||||||
if @rate.update_attributes(params[:rate])
|
if @rate.update_attributes(params[:rate])
|
||||||
flash[:notice] = 'Rate was successfully updated.'
|
flash[:notice] = 'Rate was successfully updated.'
|
||||||
format.html {
|
format.html { redirect_back_or_default(rates_url(:user_id => @rate.user_id)) }
|
||||||
if @back_url
|
|
||||||
redirect_to(@back_url)
|
|
||||||
else
|
|
||||||
redirect_to(rates_url(:user_id => @rate.user_id))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
else
|
else
|
||||||
if @rate.locked?
|
if @rate.locked?
|
||||||
@@ -110,11 +98,7 @@ class RatesController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
flash[:error] = "Rate is locked and cannot be deleted" if @rate.locked?
|
flash[:error] = "Rate is locked and cannot be deleted" if @rate.locked?
|
||||||
if @back_url
|
redirect_back_or_default(rates_url(:user_id => @rate.user_id))
|
||||||
redirect_to(@back_url)
|
|
||||||
else
|
|
||||||
redirect_to(rates_url(:user_id => @rate.user_id))
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user