hi, my url after performing a call to a database looks like this: http://localhost:3000/myapp/view?scat=3&mcat=4 is there a way to chop off the "?scat=3&mcat=4" part of the url? -- 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 -~----------~----~----~----~------~----~------~--~---
well without a refresh or a render i think not koloa wrote:> hi, > my url after performing a call to a database looks like this: > > http://localhost:3000/myapp/view?scat=3&mcat=4 > > is there a way to chop off the "?scat=3&mcat=4" part of the url?-- 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 -~----------~----~----~----~------~----~------~--~---
koloa wrote:> hi, > my url after performing a call to a database looks like this: > > http://localhost:3000/myapp/view?scat=3&mcat=4 > > is there a way to chop off the "?scat=3&mcat=4" part of the url?How about url.sub(/\?.*/, '''') Example: irb(main):015:0> url = ''http://localhost:3000/myapp/view?scat=3&mcat=4'' => "http://localhost:3000/myapp/view?scat=3&mcat=4" irb(main):016:0> url.sub(/\?.*/, '''') => "http://localhost:3000/myapp/view" Proper ? should normally arrive escaped in the URL. Stephan -- 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 -~----------~----~----~----~------~----~------~--~---
koloa wrote:> my url after performing a call to a database looks like this: > > http://localhost:3000/myapp/view?scat=3&mcat=4 > > is there a way to chop off the "?scat=3&mcat=4" part of the url?Can you fetch that page via POST instead of GET? The latter sends the display data as a batch of variables inside the POSTing message, not as part of the URL. Your calling function might have a :method option to switch to ''post''. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---