# How to redirect to a url that is stored inside a variable

**URL:** <https://www.ruby-forum.com/t/how-to-redirect-to-a-url-that-is-stored-inside-a-variable/187196>\
**Category:** Ruby\
**Created:** [April 19, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/how-to-redirect-to-a-url-that-is-stored-inside-a-variable/187196 "2010-04-19T16:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreevarshini\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@sreevarshini\_k](https://www.ruby-forum.com/u/sreevarshini_k)\
**Post date:** [April 19, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/how-to-redirect-to-a-url-that-is-stored-inside-a-variable/187196/1 "2010-04-19T16:35:05Z")

</div>

I am trying to redirect to an url by using the method redirect\_to but  
the URL is stored in a variable. i tried to give some thing like this

redirect\_to (@redirectURL)  
but it dint worked

Plz help me out

Thanks  
sreevarshini

---

<div class="post-metadata">

**Author:** ![sreevarshini\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@sreevarshini\_k](https://www.ruby-forum.com/u/sreevarshini_k)\
**Post date:** [April 19, 2010, 10:31pm UTC](https://www.ruby-forum.com/t/how-to-redirect-to-a-url-that-is-stored-inside-a-variable/187196/2 "2010-04-19T22:31:30Z")

</div>

Sreevarshini K. wrote:

> I am trying to redirect to an url by using the method redirect\_to but  
> the URL is stored in a variable. i tried to give some thing like this
> 
> redirect\_to (@redirectURL)  
> but it dint worked

There is no ‘redirect\_to’ method in the core Ruby language. I guess  
you’re talking about Rails - please asks Rails questions on a Rails  
mailing list.
