Adam, I thought that would work too... but it doesn't ! Setup a little test, and you'll see what I mean.<br>Doing this window.location thing is all I can get to work. Check this thread out:<br><a href="http://thread.gmane.org/gmane.comp.lang.ruby.rails/14202">
http://thread.gmane.org/gmane.comp.lang.ruby.rails/14202</a><br><br><br><br><div><span class="gmail_quote">On 1/30/06, <b class="gmail_sendername">Adam Denenberg</b> <<a href="mailto:straightflush@gmail.com">straightflush@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">redirect_to :controller => "admin" , :action => "index"
<br><br>adam<br><br>On 1/30/06, Dylan Stamat <<a href="mailto:dylans@gmail.com">dylans@gmail.com</a>> wrote:<br>> I would like to have a login box setup so that if incorrect info is<br>> submitted, the box "shakes" via
Effect.Shake.<br>> If the correct information is submitted, I want to redirect to some other<br>> page.<br>><br>> The only solution I've found is the following, which is pretty ugly, as it<br>> displays the javascript I'm invoking on the page prior to the redirect.
<br>> Here is the code:<br>><br>><br>> The Form<br>> ============<br>> <%= form_remote_tag(:update => 'message',<br>> :complete =><br>> evaluate_remote_response,
<br>> :url =><br>> {:controller => 'login', :action => 'login'}) %><br>><br>> The Action<br>> ============<br>> if logged_in<br>> render(:text => "
window.location.href = '<a href="http://0.0.0.0:3000/admin';">http://0.0.0.0:3000/admin';</a>")<br>> else<br>> render(:layout => false, :action => 'bad_login') <-- which is just a<br>> template with an
Effect.Shake<br>><br>><br>> So, is there any other way to do a redirect from an action via a<br>> form_remote_tag than using the window.location hack ?<br>> Crossing my fingers there is a way :)<br>> TIA !
<br>><br>> _______________________________________________<br>> Rails mailing list<br>> <a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org</a><br>> <a href="http://lists.rubyonrails.org/mailman/listinfo/rails">
http://lists.rubyonrails.org/mailman/listinfo/rails</a><br>><br>><br>><br>_______________________________________________<br>Rails mailing list<br><a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org
</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails">http://lists.rubyonrails.org/mailman/listinfo/rails</a><br></blockquote></div><br>