Rails route rewriting quesiton

Posted by Jonathan on Stack Overflow See other posts from Stack Overflow or by Jonathan
Published on 2010-05-18T03:06:44Z Indexed on 2010/05/18 3:10 UTC
Read the original article Hit count: 331

Filed under:
|
|
|

Hi guys,

I think this is an easy question. I am using this useful Flash Document Reader called FlexPaper. I have it embeded in one of my Show pages. But when I click the a link on their tool bar to show the document in a new browser, it points to the following link ...

http://0.0.0.0:3000/intels/FlexPaperViewer.swf?ZoomTime=0.5&FitPageOnLoad=false&PrintEnabled=false&SwfFile=%2FPaper.swf

which doesn't work, but if I remove the "intels" from the path so the url looks like:

http://0.0.0.0:3000/FlexPaperViewer.swf?ZoomTime=0.5&FitPageOnLoad=false&PrintEnabled=false&SwfFile=%2FPaper.swf

It works fine.

My question is what is the best way to handle this. Can you write a route that rewrites a url that starts with intels/FlexPaperViewer.swf and removes the intels prefix? What would that look like?

Is there a better option?

Thanks!

Jonathan

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routing