Is there a Javascript/Prototype helper with which you can use redirect_to? Ive been searching all around and can''t seem to find any information about this. I need to use an ajax helper to send data from a javascript function. I have been using link_to_remote and passing the data like so: :with => "''data=''+newFunction()". But by using link_to_remote, I am unable to redirect to another action, which is somewhat limiting. Any input is appreciated. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 3, 9:12 am, David <dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is there a Javascript/Prototype helper with which you can use > redirect_to? Ive been searching all around and can''t seem to find any > information about this. I need to use an ajax helper to send data > from a javascript function. I have been using link_to_remote and > passing the data like so: :with => "''data=''+newFunction()". But by > using link_to_remote, I am unable to redirect to another action, which > is somewhat limiting. Any input is appreciated. Thanks.The magic page object has a method for this, funnily enough it''s called redirect_to Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David wrote:> Is there a Javascript/Prototype helper with which you can use > redirect_to? Ive been searching all around and can''t seem to find any > information about this. I need to use an ajax helper to send data > from a javascript function. I have been using link_to_remote and > passing the data like so: :with => "''data=''+newFunction()". But by > using link_to_remote, I am unable to redirect to another action, which > is somewhat limiting. Any input is appreciated. Thanks.there is no redirect_to helper for Ajax environment you can use link_to_remote "Delete", :update => "div_id", :url => {:controller=>'''',:action=>''''}, :method => :delete, :html => { :class => "divs" } or link_to_remote "Delete", :update => "div_id", :url => { :action => "", :id => @id } -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
So is there any way to pass the result of a javascript function to an action in order to save information to the database and then use redirect_to? On Oct 3, 1:27 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> David wrote: > > Is there a Javascript/Prototype helper with which you can use > > redirect_to? Ive been searching all around and can''t seem to find any > > information about this. I need to use an ajax helper to send data > > from a javascript function. I have been using link_to_remote and > > passing the data like so: :with => "''data=''+newFunction()". But by > > using link_to_remote, I am unable to redirect to another action, which > > is somewhat limiting. Any input is appreciated. Thanks. > > there is no redirect_to helper for Ajax environment > > you can use > link_to_remote "Delete", :update => "div_id", > :url => {:controller=>'''',:action=>''''}, :method => :delete, > :html => { :class => "divs" } > or > link_to_remote "Delete", :update => "div_id", :url => { :action => "", > :id => @id } > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 3, 9:40 am, David <dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So is there any way to pass the result of a javascript function to an > action in order to save information to the database and then use > redirect_to? >The below information is wrong. When using rjs you can redirect (but you need to use page.redirect_to, not redirect_to) Fred> On Oct 3, 1:27 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > David wrote: > > > Is there a Javascript/Prototype helper with which you can use > > > redirect_to? Ive been searching all around and can''t seem to find any > > > information about this. I need to use an ajax helper to send data > > > from a javascript function. I have been using link_to_remote and > > > passing the data like so: :with => "''data=''+newFunction()". But by > > > using link_to_remote, I am unable to redirect to another action, which > > > is somewhat limiting. Any input is appreciated. Thanks. > > > there is no redirect_to helper for Ajax environment > > > you can use > > link_to_remote "Delete", :update => "div_id", > > :url => {:controller=>'''',:action=>''''}, :method => :delete, > > :html => { :class => "divs" } > > or > > link_to_remote "Delete", :update => "div_id", :url => { :action => "", > > :id => @id } > > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Okay, I will look into that. Thanks. On Oct 3, 1:46 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Oct 3, 9:40 am, David <dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So is there any way to pass the result of a javascript function to an > > action in order to save information to the database and then use > > redirect_to? > > The below information is wrong. When using rjs you can redirect (but > you need to use page.redirect_to, not redirect_to) > > Fred > > > On Oct 3, 1:27 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > wrote: > > > > David wrote: > > > > Is there a Javascript/Prototype helper with which you can use > > > > redirect_to? Ive been searching all around and can''t seem to find any > > > > information about this. I need to use an ajax helper to send data > > > > from a javascript function. I have been using link_to_remote and > > > > passing the data like so: :with => "''data=''+newFunction()". But by > > > > using link_to_remote, I am unable to redirect to another action, which > > > > is somewhat limiting. Any input is appreciated. Thanks. > > > > there is no redirect_to helper for Ajax environment > > > > you can use > > > link_to_remote "Delete", :update => "div_id", > > > :url => {:controller=>'''',:action=>''''}, :method => :delete, > > > :html => { :class => "divs" } > > > or > > > link_to_remote "Delete", :update => "div_id", :url => { :action => "", > > > :id => @id } > > > > -- > > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---