# Problem redirecting to rjs template

**URL:** <https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616>\
**Category:** Rails\
**Created:** [November 20, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616 "2006-11-20T14:46:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [November 20, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616/1 "2006-11-20T14:46:42Z")

</div>

I’m working with two controllers- login and admin. When the login  
action in the login controller has worked out successfully, it  
redirects to an index.rjs template in the admin controller. The  
problem is that this rjs template doesn’t get interpreted, so I’m left  
with a screenful of javascript.

Here’s the login action:

def login  
if request.get?  
session[:user\_id] = nil  
@user = User.new  
else  
@user = User.new(params[:user])  
logged\_in\_user = @user.try\_to\_login  
if logged\_in\_user  
session[:user\_id] = logged\_in\_user.id  
session[:user\_name] = logged\_in\_user.name  
session[:user\_roommate] = logged\_in\_user.roommate  
jumpto = session[:jumpto] || {:controller =\> “admin”, :action  
=\>“index”}  
session[:jumpto] = nil  
redirect\_to(jumpto)  
else  
flash[:notice] = “Invalid user/password combination”  
end  
end  
end

… and here’s the index.rjs that it redirects to:

page.replace\_html ‘content’, :partial =\> ‘list’  
page.replace\_html ‘nav’, :partial =\> ‘nav\_this\_month’

… and here’s what ends up on my screen:  
try {  
Element.update(“content”, “\<div id=“payments”\>\n\<div  
id=“form”\>\n\t\<form action=”/admin/create/23" method=“post”  
onsubmit=“new Ajax.Request(’/admin/create/23’, {asynchronous:true,  
evalScripts:true, parameters:Form.serialize(this)}); return  
false;”\>\n

\n\n\<tr id=“form\_row”\>\t\n\t\<th  
class=“date”\>\<input id=“payment\_date” name=“payment[date]”  
order=“monthdayyear” size=“9” type=“text”  
use\_month\_numbers=“true” value=“11/19/2006” /\>\n\t\<th  
class=“payee”\>\<input id=“payment\_payee” maxsize=“15”  
name=“payment[payee]” size=“12” type=“text” value=“payee”  
/\>\n \t\<th class=“note”\>\<input id=“payment\_note”  
maxsize=“17” name=“payment[note]” size=“17” type=“text”  
value=“note” /\>\n\t\<th class=“payer”\>\<select  
id=“payment\_payer” name=“payment[payer]”\>\<option  
value=“chris”\>chris\n\<option value=“josh”  
selected=“selected”\>josh\n\t\<th  
class=“amount”\>\<input id=“form\_amount” maxsize=“8”  
name=“payment[amount]” size=“7” type=“text” value=“0.00”  
/\>\n\t\<th class=“divvy” id=“form\_submit”\>\<input  
name=“commit” type=“submit” value=“divvy!”  
/\>\n\n\n

\n\n\n\n\t\<tr  
id=“register\_header”\>\n\t\t\<th class=“date”\>\<a href="#"  
onclick=“new Ajax.Request(’/admin/previous\_month’, {asynchronous:true,  
evalScripts:true}); return  
false;”\>\<\<\n\t\t\t\t\t\tdate\n\t\t\t\t\t\t\<a href="#"  
onclick=“new Ajax.Request(’/admin/next\_month’, {asynchronous:true,  
evalScripts:true}); return false;”\>\>\>\n\t\t\t\t\t\t\n\t\t\<th  
class=“payee”\>payee\<th class=“note”\>note\<th  
class=“payer”\>payer\<th class=“amount”  
id=“register\_header\_amount”\>amount\<th class=“divvy”  
id=“register\_header\_divvy”\>divvy\<th  
id=“register\_header\_runningbalance”\>balance\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$10.00\t\t\n\t\<td  
class=“divvy”\>$-5.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-25.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr class = debit  
id=“5”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$20.00\t\t\n\t\<td  
class=“divvy”\>$-10.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-20.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr class = debit  
id=“14”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$10.00\t\t\n\t\<td  
class=“divvy”\>$-5.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-10.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr id=  
“26”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$20.00\t\t\n\t\<td  
class=“divvy”\>$10.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-5.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr class = debit  
id=“27”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$10.00\t\t\n\t\<td  
class=“divvy”\>$-5.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-15.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr class = debit  
id=“32”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$10.00\t\t\n\t\<td  
class=“divvy”\>$-5.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-10.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr class = debit  
id=“20”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=“amount”\>$10.00\t\t\n\t\<td  
class=“divvy”\>$-5.00\n\n\t\<td  
class=“runningbalance\_debit”\>$-5.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\n\<tr class =“debit”  
id=“balance\_fwd”\>\n\t\n\t\n\t\n\t\n\t\<td class=“amount”\>\t\t\n\t\<td  
class=“divvy”\>\n\t\<td  
class=“runningbalance\_debit”\>$-10.00\n\n\n\t\t\n

| | \n\t\t\<tbody  
id=“register”\>\n\t\t\n\n\<tr class = debit  
id=“21”\>\n\n\t | 11/16/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/21’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/21’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/14/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/5’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/5’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/14/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/14’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/14’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/14/2006 | payee | note | chris | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/26’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/26’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/14/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/27’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/27’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/14/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/32’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/32’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/12/2006 | payee | note | josh | \<a href="#" onclick=“new  
Ajax.Request(’/admin/edit/20’, {asynchronous:true, evalScripts:true});  
return false;”\>\<img alt=“Edit” border=“0”  
src="/images/edit.png?1142214964" /\> | \<a  
href="#" onclick=“new Ajax.Updater(‘register’, ‘/admin/destroy/20’,  
{asynchronous:true, evalScripts:true}); return false;”\>\<img  
alt=“Destroy” border=“0” src="/images/destroy.png?1142214730"  
/\> | 11/1/2006 | | Balance  
Forward | |

\n\n\n\n\n");  
Element.update(“nav”, “\<dt id=“logo”\>divvy\n\t \n\t\t\<dd  
id=“t-logout”\>\n\t\t\<a href=”/login/logout"\>Log  
out\n\t\n\t\t\n\t\<dd id=“t-profile”\>\n\t\t\<a href="#"  
onclick=“new Ajax.Request(’/login/edit\_user’, {asynchronous:true,  
evalScripts:true}); return false;”\>Profile\n\t\n\t\<dd  
id=“selected”\>\n\t\t\<a href="#" onclick=“new  
Ajax.Request(’/admin/this\_month’, {asynchronous:true,  
evalScripts:true}); return false;”\>This Month\n\t\n\t");  
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());  
alert(‘Element.update(“content”, “\<div id=\“payments\”\>\n\<div  
id=\“form\”\>\n\t\<form action=\”/admin/create/23\" method=\“post\”  
onsubmit=\"new Ajax.Request(’/admin/create/23’, {asynchronous:true,  
evalScripts:true, parameters:Form.serialize(this)}); return  
false;\"\>\n\n\n\<tr id=\“form\_row\”\>\t\n\t\<th  
class=\“date\”\>\<input id=\“payment\_date\” name=\“payment[date]\”  
order=\“monthdayyear\” size=\“9\” type=\“text\”  
use\_month\_numbers=\“true\” value=\“11/19/2006\” /\>\n\t\<th  
class=\“payee\”\>\<input id=\“payment\_payee\” maxsize=\“15\”  
name=\“payment[payee]\” size=\“12\” type=\“text\”  
value=\“payee\” /\>\n \t\<th class=\“note\”\>\<input  
id=\“payment\_note\” maxsize=\“17\” name=\“payment[note]\”  
size=\“17\” type=\“text\” value=\“note\” /\>\n\t\<th  
class=\“payer\”\>\<select id=\“payment\_payer\”  
name=\“payment[payer]\”\>\<option  
value=\“chris\”\>chris\n\<option value=\“josh\”  
selected=\“selected\”\>josh\n\t\<th  
class=\“amount\”\>\<input id=\“form\_amount\” maxsize=\“8\”  
name=\“payment[amount]\” size=\“7\” type=\“text\”  
value=\“0.00\” /\>\n\t\<th class=\“divvy\”  
id=\“form\_submit\”\>\<input name=\“commit\” type=\“submit\”  
value=\“divvy!\”  
/\>\n\n\n

\n\n\n\n\t\<tr  
id=\“register\_header\”\>\n\t\t\<th class=\“date\”\>\<a href=\"#\"  
onclick=\“new Ajax.Request(’/admin/previous\_month’,  
{asynchronous:true, evalScripts:true}); return  
false;\”\>\<\<\n\t\t\t\t\t\tdate\n\t\t\t\t\t\t\<a href=\"#\"  
onclick=\“new Ajax.Request(’/admin/next\_month’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\>\>\n\t\t\t\t\t\t\n\t\t\<th  
class=\“payee\”\>payee\<th class=\“note\”\>note\<th  
class=\“payer\”\>payer\<th class=\“amount\”  
id=\“register\_header\_amount\”\>amount\<th class=\“divvy\”  
id=\“register\_header\_divvy\”\>divvy\<th  
id=\“register\_header\_runningbalance\”\>balance\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$10.00\t\t\n\t\<td  
class=\“divvy\”\>$-5.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-25.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
class = debit  
id=\“5\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$20.00\t\t\n\t\<td  
class=\“divvy\”\>$-10.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-20.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
class = debit  
id=\“14\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$10.00\t\t\n\t\<td  
class=\“divvy\”\>$-5.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-10.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
id=  
\“26\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$20.00\t\t\n\t\<td  
class=\“divvy\”\>$10.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-5.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
class = debit  
id=\“27\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$10.00\t\t\n\t\<td  
class=\“divvy\”\>$-5.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-15.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
class = debit  
id=\“32\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$10.00\t\t\n\t\<td  
class=\“divvy\”\>$-5.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-10.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\<tr  
class = debit  
id=\“20\”\>\n\n\t\n\t\n\t\n\t\n\t\<td  
class=\“amount\”\>$10.00\t\t\n\t\<td  
class=\“divvy\”\>$-5.00\n\n\t\<td  
class=\“runningbalance\_debit\”\>$-5.00\n\t\t\n\t\t  
\n\t\t\n\t\t\n\t\t\n\t\t\n\n\n\n\n\<tr  
class =\“debit\”  
id=\“balance\_fwd\”\>\n\t\n\t\n\t\n\t\n\t\<td class=\“amount\”\>\t\t\n\t\<td  
class=\“divvy\”\>\n\t\<td  
class=\“runningbalance\_debit\”\>$-10.00\n\n\n\t\t\n

| | \n\t\t\<tbody  
id=\“register\”\>\n\t\t\n\n\<tr class = debit  
id=\“21\”\>\n\n\t | 11/16/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/21’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/21’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/14/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/5’, {asynchronous:true, evalScripts:true});  
return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/5’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/14/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/14’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/14’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/14/2006 | payee | note | chris | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/26’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/26’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/14/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/27’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/27’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/14/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/32’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/32’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/12/2006 | payee | note | josh | \<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/edit/20’, {asynchronous:true,  
evalScripts:true}); return false;\”\>\<img alt=\“Edit\” border=\“0\”  
src=\"/images/edit.png?1142214964\" /\> | \<a  
href=\"#\" onclick=\“new Ajax.Updater(‘register’,  
‘/admin/destroy/20’, {asynchronous:true, evalScripts:true}); return  
false;\”\>\<img alt=\“Destroy\” border=\“0\”  
src=\"/images/destroy.png?1142214730\" /\> | 11/1/2006 | | Balance  
Forward | |

\n\n\n\n\n");\nElement.update(“nav”,  
“\<dt id=\“logo\”\>divvy\n\t \n\t\t\<dd id=\“t-logout\”\>\n\t\t\<a  
href=\”/login/logout\"\>Log out\n\t\n\t\t\n\t\<dd  
id=\“t-profile\”\>\n\t\t\<a href=\"#\" onclick=\“new  
Ajax.Request(’/login/edit\_user’, {asynchronous:true,  
evalScripts:true}); return false;\”\>Profile\n\t\n\t\<dd  
id=\“selected\”\>\n\t\t\<a href=\"#\" onclick=\“new  
Ajax.Request(’/admin/this\_month’, {asynchronous:true,  
evalScripts:true}); return false;\”\>This Month\n\t\n\t");’);  
throw e }

Any suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [November 20, 2006, 4:00pm UTC](https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616/2 "2006-11-20T16:00:09Z")

</div>

Hi Josh,  
Does your default layout contain the declaration to prototype.js?  
You should have  
\<%= javascript\_include\_tag :defaults %\>  
somewhere in the head of your index rhtml. One common place to put it  
is in application.rhtml.

regards,  
Dave

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [November 20, 2006, 4:30pm UTC](https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616/3 "2006-11-20T16:30:43Z")

</div>

For what it’s worth, I find that it’s too easy to screw this up. I’ve  
just been bitten (yet again) and all of my rjs/javascript is spewing  
onto the page. simply by confusing when to use :url in a link\_to caused  
it:

```
<%= link_to "Print Packing Slip", :url => {:controller =>

```

@controller\_name, :action =\> ‘print’},  
:popup =\> [‘new\_window’, ‘menubar,resizable=true’] %\> ||

should be

```
<%= link_to "Print Packing Slip", {:controller => @controller_name,

```

:action =\> ‘print’},  
:popup =\> [‘new\_window’, ‘menubar,resizable=true’] %\> ||

So, Josh, good luck. I’ll send more random thoughts about this problem  
as they come to me.Hope it helps!  
Dave

---

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [November 20, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/problem-redirecting-to-rjs-template/76616/4 "2006-11-20T16:48:53Z")

</div>

you redirect\_to a new action, which means the browser loads a new page.  
so why do you want to render a RJS template anyway?  
RJS templates are only meant for responding to an AJAX request, it  
sends Javascript back to the brwoser WITHOUT loading a new page, and  
prototype.js will execute the javascript an replace the corresponding  
stuff.  
now, if you redirect to a new page, the browser doesn’t do an AJAX  
request, but a normal HTTP request, and the javascript it gets served  
by the server isn’t evaluated.

sop are you even doing the login procedure via an AJAX call  
(form\_remote or sth.)?
