Skip to content

Commit

Permalink
Refactor: extract back_url method to ApplicationController.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3912 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
edavis10 committed Aug 4, 2010
1 parent a544a1e commit 8c79385
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -218,6 +218,10 @@ def check_project_privacy
end
end

def back_url
params[:back_url] || request.env['HTTP_REFERER']
end

def redirect_back_or_default(default)
back_url = CGI.unescape(params[:back_url].to_s)
if !back_url.blank?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/issues_controller.rb
Expand Up @@ -349,7 +349,7 @@ def context_menu

@priorities = IssuePriority.all.reverse
@statuses = IssueStatus.find(:all, :order => 'position')
@back = params[:back_url] || request.env['HTTP_REFERER']
@back = back_url

render :layout => false
end
Expand Down

0 comments on commit 8c79385

Please sign in to comment.