I'm using ROR 1.0 and the included prototype.js to do some AJAX stuff. I'm using the form_remote_tag to submit a login form using AJAX. So, any error/failed login will be displayed using AJAX. But, for successful login, I would want it to reload the wholepage, not just update the <DIV>. How can I achieve this?
on 2006-01-05 02:47
on 2006-01-05 03:18
on 2006-01-05 13:06
on 2006-01-05 13:54
ok I got it.. render :nothing => true, :status => 401
on 2006-01-05 14:00
on 2006-01-05 14:19
Hi Carlos, Thanks for the example..Thats what I was looking for .Just one small thing. Whats the false parameter you pass to window.location.reload(). I actually want to do something like redirecting to the user's homepage if the password/username is correct. So I suppose something like this should work. document.href='/matters_crud/home' Vivek
on 2006-01-29 16:00
Hi all: I'm doing something similar to this but for an account signup controller. So once the user successfully creates an account, the user is redirected to index.rhtml by window.location.href = "http://localhost:3000"; I have a problem where the session hash gets deleted on the first time through the process, but not deleted on subsequent times. I'd like to preserve session[:user_id] from a successful account creation/login, but it never works the first time. I can see session[:user_id] = @user.id being set in irb, but after the redirect session[:user_id] = nil. And as previously stated, this works when I create a new account during the same browser session. Has anyone else had this problem? Boram
on 2006-01-29 16:02
Clarification: > as previously stated, this works when I create a new account during the > same browser session. should read > as previously stated, this works when I subsequently create new accounts during > the same browser session.
on 2006-01-30 01:13
I would have thought that RJS provides a much cleaner solution. update.rjs: if @matter.valid? page << 'location.reload(false);' else page.replace_html 'ajax_div', :partial => 'error' end -Jonny.