# Redirect to pdf

**URL:** <https://www.ruby-forum.com/t/redirect-to-pdf/122192>\
**Category:** Ruby\
**Created:** [December 5, 2007, 12:50pm UTC](https://www.ruby-forum.com/t/redirect-to-pdf/122192 "2007-12-05T12:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bober](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@Bober](https://www.ruby-forum.com/u/Bober)\
**Post date:** [December 5, 2007, 12:50pm UTC](https://www.ruby-forum.com/t/redirect-to-pdf/122192/1 "2007-12-05T12:50:51Z")

</div>

Hello!  
in folder public/pdf I have a file “test.pdf”

when I try it open [http://127.0.0.1:3001/pdf/test.pd](http://127.0.0.1:3001/pdf/test.pd)  
everything is ok, browser open test.pdf.

but when I try to redirect in method  
(redirect\_to\_path “/pdf/test.pdf” )

I see error

no route found to match “/pdf/test.pdf” with {:method=\>:get}

what is wrong?

---

<div class="post-metadata">

**Author:** ![Bober](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@Bober](https://www.ruby-forum.com/u/Bober)\
**Post date:** [December 5, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/redirect-to-pdf/122192/2 "2007-12-05T14:30:40Z")

</div>

On 12/5/07, Bober [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> no route found to match “/pdf/test.pdf” with {:method=\>:get}
> 
> what is wrong?

…that you’re asking a Rails on ruby-talk. I also suspect that a Google  
search would answer your question quickly, although I’m not sure  
because I don’t actually use rails.

-austin

---

<div class="post-metadata">

**Author:** ![Bober](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5e925/32.png) [@Bober](https://www.ruby-forum.com/u/Bober)\
**Post date:** [December 5, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/redirect-to-pdf/122192/3 "2007-12-05T21:58:20Z")

</div>

On Wed, Dec 05, 2007 at 08:50:14PM +0900, Bober wrote:

> Hello!  
> in folder public/pdf I have a file “test.pdf”
> 
> when I try it open [http://127.0.0.1:3001/pdf/test.pd](http://127.0.0.1:3001/pdf/test.pd)  
> everything is ok, browser open test.pdf.
> 
> but when I try to redirect in method  
> (redirect\_to\_path “/pdf/test.pdf” )

Are you sure that leading / is supposed to be there? Maybe it should be  
“pdf/test.pdf” instead of “/pdf/test.pdf”.

I’m not really much of a Rails user (I’ve just toyed with it a little),  
but that’s the first thing that leaps to mind.
