[LRUG] Redirect in ajax.

Matthew Rudy Jacobs matthewrudyjacobs at gmail.com
Sun May 2 06:57:55 PDT 2010


I think the javascript needed is just
"window.location.href = 'http://you.rm.um'"

On 2 May 2010 20:09, Oliver Stocks <stocks.oliver at gmail.com> wrote:

> Works so nice, i wonder i didn't try it. Thought it was super-mega complex.
> Karma to you.
>
>
>
> 2010/5/2 Pratik <pratiknaik at gmail.com>
>
> render(:update) {|page| page.redirect_to whatever_path }
>>
>> On Sun, May 2, 2010 at 12:31 PM, Oliver Stocks <stocks.oliver at gmail.com>
>> wrote:
>> > Hello comrades,
>> >
>> > I wondering if it's possible to redirect a browser in AJAX, i failed a
>> few
>> > years but i didn't this group! I'm remaking the sliding panel the code
>> in
>> > only a draft for now:
>> >
>> > test_controller.rb
>> >   # Login
>> >   def create
>> >     @user_session = UserSession.new(params[:user_session])
>> >
>> >     if @user_session.save
>> >       # Login, Geat !
>> >       if (request.xhr?)
>> >         # TODO: Find how it redirect
>> >         render :text => "Login successful!"
>> >       end
>> >     else
>> >       # Login is wrong
>> >         @warning = "Wrong login or/and password!"
>> >         render :partial => "form_wide"
>> >     end
>> >   end
>> >
>> > I can make a normal form but if the login info is wrong, if feel that
>> > reloaded the entire page is a bit worthless.
>> > Any help is help! I doubt i can it, do but invalidrecord stated you
>> > awesomeness.
>> >
>> > Oliver Stocks
>> >
>> > _______________________________________________
>> > Chat mailing list
>> > Chat at lists.lrug.org
>> > http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>> >
>> >
>>
>>
>>
>> --
>> Programmer @ 37signals | http://twitter.com/lifo | http://m.onkey.org
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100502/a0753e79/attachment.html>


More information about the Chat mailing list