how to escape from AJAX URL
Within my "login.rjs" template that get's invoked after my login process, it returns to the same page with an error message on error, or... if the login was successful, it needs to "redirect" to another controller... which is pretty much impossible to do otherwise. so, my " login.rjs" looks like:
if @logged_in_client page.replace_html "message", :partial => 'shared/bad_login' else page.redirect_to "whatever you want here" end
------ End Message--------
Here is my two cents:
Technically, you can do this without a RJS template at all, because it is such a simple example. Use this in your controller
render :update do |page| if @logged_in_client page.replace_html "message", :partial => 'shared/bad_login' else page.redirect_to "whatever you want here" end end