diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 03af71b99..30d8f3bf2 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -79,7 +79,7 @@ class VersionsController < ApplicationController respond_to do |format| format.html do flash[:notice] = l(:notice_successful_create) - redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project + redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project end format.js do # IE doesn't support the replace_html rjs method for select box options @@ -108,7 +108,7 @@ class VersionsController < ApplicationController attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) if @version.update_attributes(attributes) flash[:notice] = l(:notice_successful_update) - redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project + redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project else respond_to do |format| format.html { render :action => 'edit' } @@ -127,7 +127,7 @@ class VersionsController < ApplicationController def destroy if @version.fixed_issues.empty? @version.destroy - redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project + redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project else flash[:error] = l(:notice_unable_delete_version) redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project diff --git a/app/views/versions/_form.rhtml b/app/views/versions/_form.rhtml index b829cf2f8..61bba046c 100644 --- a/app/views/versions/_form.rhtml +++ b/app/views/versions/_form.rhtml @@ -1,3 +1,4 @@ +<%= back_url_hidden_field_tag %> <%= error_messages_for 'version' %>