views:

30

answers:

1

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, I get the following error

ActiveRecord::RecordNotFound in IntelsController#show

Couldn't find Intel with ID=FlexPaperViewer

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

A: 

Juat a thought, how about placing the FlexPaperViewer.swf inside public/intels folder?

So the directory structure will be

<project-directory>/public/intels/FlexPaperViewer.swf

Doing this will make the link correct. It seems to be easier to do it this way. Hopefully it helps.

EDIT

Another alternative will be to see how the link was generated, maybe there is a parameter that you can set when you embed the FlexPaper.

I am not aware of any route modification that can do what you want. Maybe someone else can help on this.

SamChandra
Interesting thought, I will try that first thing this morning.
Jonathan
This doesn't work -- rails routing captures the url first and throws an error. I updated the question with the error
Jonathan