Redirect back to where I came from when loggin in via the menu form

This commit is contained in:
Holger Just 2011-12-18 12:28:32 +01:00
parent 58a7182e2d
commit 0049f82182
2 changed files with 4 additions and 0 deletions

View File

@ -281,6 +281,9 @@ class ApplicationController < ActionController::Base
end
def redirect_back_or_default(default)
p params[:back_url].to_s
p URI.escape(CGI.unescape(params[:back_url].to_s))
back_url = URI.escape(CGI.unescape(params[:back_url].to_s))
if !back_url.blank?
begin

View File

@ -1,5 +1,6 @@
<div id="nav-login-content">
<% form_tag({:controller => "account", :action=> "login"}) do %>
<%= hidden_field_tag('back_url', CGI.escape(request.url)) %>
<table>
<tr>
<td><label for="username-pulldown"><%= l(:field_login) %></label></td>