I''ve run in to a strange situation where it would be great if there were a way to use " redirect_to :back " to skip back over the previous page and go to the previous, previous page ( :back X 2.) Any one have any ideas how to do this? I think I might end up trying to use the session some how, but want to avoid implementing my own system if possible. Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/vYYprx7IanEJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 23, 12:46 am, Don <don.leat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve run in to a strange situation where it would be great if there were a > way to use " redirect_to :back " to skip back over the previous page and go > to the previous, previous page ( :back X 2.) Any one have any ideas how to > do this?The best thing that you can do is store the link where you want the application to redirect_to in a later stage and use it with the redirect_to syntax eg: session[:return_to] = request.fullpath (use this inside the controller action where you would like to redirect to) and then use redirect_to session[:return_to] -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Andreas Arnold
2012-Jan-23 09:54 UTC
Re: redirect_to :back - Any way to go back two pages?
If you don''t mind to use Javascript for it, you could use window.history.go(-2) (More on that here: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#Moving_to_a_specific_point_in_history) On Jan 23, 12:46 am, Don <don.leat...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve run in to a strange situation where it would be great if there were a > way to use " redirect_to :back " to skip back over the previous page and go > to the previous, previous page ( :back X 2.) Any one have any ideas how to > do this? I think I might end up trying to use the session some how, but > want to avoid implementing my own system if possible. > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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 Mon, Jan 23, 2012 at 00:46, Don <don.leatham-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve run in to a strange situation where it would be great if there were a > way to use " redirect_to :back " to skip back over the previous page and go > to the previous, previous page ( :back X 2.) Any one have any ideas how to > do this? I think I might end up trying to use the session some how, but > want to avoid implementing my own system if possible.How are you currently paginating? Some of the existing pagination gems might (I haven''t looked) have features to provide individual links to the next and previous *few* pages, maybe even adjustable. For instance, if you''re on page 7 out of 24, it might provide not only arrows to 6 and 8, but numeric links to 4, 5, 6, 8, 9, and 10 (and possibly arrow and/or numeric links to 1 and 24). -Dave -- Dave Aronson, Available Cleared Ruby on Rails Freelancer (NoVa/DC/Remote); details @ http://www.DaveAronson.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
I was trying to avoid this approach as I expected it would be a little complex, but your code shows that it is pretty straightforward. Thanks for taking the time to write it out. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/L31IFT0eddsJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for the idea. Unfortunately the :back :back process that I need to do is back to a previous model in a different view, so pagination won''t do it for me. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jHu4sZN5TL4J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Cool! Had not thought of this approach at all. I have very weak JS skills, but I''ll look into this. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/u5BumHfS6pMJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Vandenabeele
2012-Jan-24 23:14 UTC
Re: Re: redirect_to :back - Any way to go back two pages?
On Tue, Jan 24, 2012 at 11:14 PM, Don <don.leatham-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Cool! Had not thought of this approach at all. I have very weak JS > skills, but I''ll look into this.Hi Don. FYI, Attached is a screen shot of how I see your 3 recent mails in Gmail. To me they seem like 3 short messages without context. I think you could get more help/feedback if you leave a little context quoted above, showing to what you are actually responding. I double checked in the original message text (as presented to me by Gmail) and that seems to confirm that there is not real quoted context. No big problem, it''s just that you might get more/better feedback with proper quoting a context. Hope This Helps, Peter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dave Aronson
2012-Jan-24 23:27 UTC
Re: Re: redirect_to :back - Any way to go back two pages?
On Tue, Jan 24, 2012 at 18:14, Peter Vandenabeele <peter-jNuWw7i2w7syMbTcgqFhxg@public.gmane.org> wrote:> I think you could get more help/feedback if you leave a little context > quoted above, showing to what you are actually responding.Just don''t dare top-post, without nomex on. ;-) -Dave -- Dave Aronson, Available Cleared Ruby on Rails Freelancer (NoVa/DC/Remote); details @ http://www.DaveAronson.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Vandenabeele
2012-Jan-25 08:59 UTC
Re: Re: redirect_to :back - Any way to go back two pages?
On Wed, Jan 25, 2012 at 12:27 AM, Dave Aronson < googlegroups2dave-BRiZGj7G2yRXqviUI+FSNg@public.gmane.org> wrote:> Just don''t dare top-post, without nomex on. ;-) >Dave, thanks for the hint :-) Don, sorry for being pedantic. Peter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> FYI, Attached is a screen shot of how I see your 3 recent mails in Gmail. > To me they > seem like 3 short messages without context. I think you could get more > help/feedback > if you leave a little context quoted above, showing to what you are > actually responding. > > > Thanks Peter. Appreciate the feedback.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MnuKc-m1HFIJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If you can do it in JavaScript, you can always just do window.history.go(-2) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/84XQPpvPqsEJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.