From bfb53ee81f3fe408485af0254196208f685d58e8 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 18 Oct 2010 18:17:08 -0400 Subject: [PATCH] add ?return_to to login urls --- app/helpers/application_helper.rb | 4 ++++ app/views/layouts/items.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 368b9480..0d2f783c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -13,4 +13,8 @@ module ApplicationHelper content_tag 'p', value, :class => key end end + + def login_path_with_return_to + login_path :return_to => request.request_uri + end end diff --git a/app/views/layouts/items.html.haml b/app/views/layouts/items.html.haml index 816c66c0..661c7bdf 100644 --- a/app/views/layouts/items.html.haml +++ b/app/views/layouts/items.html.haml @@ -24,7 +24,7 @@ == You have #{current_user.points} points. = link_to 'Log out', logout_path - else - = link_to login_path, :id => 'userbar-log-in' do + = link_to login_path_with_return_to, :id => 'userbar-log-in' do = image_tag auth_server_icon_url %span Log in #footer