iFrame and routes

I have the following haml line:
%iframe{‘id’ => main3Wrap_iframe,
‘src’ => “/documentation/Marketing Overview - Ralph 011.htm”,
‘width’ => ‘100%’, ‘height’ => “550”}

(main3Wrap_iframe is properly defined.)

When I attempt to run this, RoR complains that
Routing Error

No route matches “/documentation
/Marketing%20Overview%20-%20Ralph%20011.htm” with {:method=>:get}

I have no
class DocumentationController
because I don’t want one.

How do I tell RoR that the name associated with the key “src” is not to
be run through routing?

On 23 November 2010 15:52, Ralph S. [email protected] wrote:

No route matches “/documentation
/Marketing%20Overview%20-%20Ralph%20011.htm” with {:method=>:get}

I have no
class DocumentationController
because I don’t want one.

How do I tell RoR that the name associated with the key “src” is not to
be run through routing?

By putting the file in your_app/public/documentation. Then your link
will find it.

Colin

Colin L. wrote in post #963366:

By putting the file in your_app/public/documentation. Then your link
will find it.

Colin

While this works, it sorta doesn’t answer the question.

Let’s say that the document is in /documentation (not
/public/documentation), how do I tell RoR to look there instead of in
/public/documentation?

On 23 November 2010 17:26, Ralph S. [email protected] wrote:

/public/documentation), how do I tell RoR to look there instead of in
/public/documentation?

You can’t, once it gets to rails it is too late. Rails cannot access
random locations on your server (nor would you wish it to). If you
want to serve up stuff from somewhere such as /documentation then you
would have to setup your web server appropriately so that it handles
it before it gets to Rails. Not that you would want your web server
picking up stuff from /documentation either.

Colin

Hi, I’m looking for answers for the same problem… and the solution
therfore is?

=> maybe read the file in the server and create it as a tmp file in
public/

¿Is this a correct solution?

Ok, lets begin, I’m newest, sorry because this is a low level question:

If I have this, and of course I’ve saved before, this file in public dir

¿Why doesn’t work?

  • this is called from “firmas” controller and “mostrar_pdf” action

=>the iframe says, if i have Javascript:
No route matches “/firmas/public/6465_p_61_620_15674.pdf”

=>and, if i haven’t:
No route matches “/mostrar_pdf/public/6465_p_61_620_15674.pdf”

thanks a lot

On 30 November 2010 14:09, Albert C. [email protected] wrote:

Hi, I’m looking for answers for the same problem… and the solution
therfore is?

What problem?

Colin

On 30 November 2010 14:42, Albert C. [email protected] wrote:

Ok, lets begin, I’m newest, sorry because this is a low level question:

If I have this, and of course I’ve saved before, this file in public dir

Why doesn’t work?

if it is in the public folder of your app then you just want
src=“/6465_p_61_620_15674.pdf”.

Colin

Thanks, Perfect!!! as you can see I’m new in linux (mac)… all my live
with windows

Before you leave, please: this was a simple example to see somthing in
iframe, bu files, in fact are en the local network.

How i have to put, in iframe?

src="//shared_dir/dir/6465_p_61_620_15674.pdf" ???

or

src="/////shared_dir/dir/6465_p_61_620_15674.pdf" ???

thanks again

Ok, don’t panicm another wat to make the question:

id DreamWeaver i can do:

but in a ruby form (_frame_pdf.html.erb) i Can not do the same

If i inspect FireBug i get:

“try {
Element.update(“frame_oc”, " <iframe
src=“file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf”>\n”);
} catch (e) { alert(‘RJS error:\n\n’ + e.toString());
alert(‘Element.update(“frame_oc”, " <iframe
src=\“file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf\”>\n");’);
throw e }"

On 30 November 2010 15:18, Albert C. [email protected] wrote:

Please don’t top post it makes it difficult to follow the thread.
Insert your comments in the previous message. Thanks.

or

src=“/////shared_dir/dir/6465_p_61_620_15674.pdf” ???

As I said in an earlier post in the thread, you can’t unless you setup
your server (apache or whatever) to serve up these files in some way.
Otherwise you must put them under the public folder.

Colin

On 30 November 2010 15:32, Albert C. [email protected] wrote:

configure mongrel to serve these files?
No idea sorry, I think you would have to ask that on a Mongrel list.
It is not a Rails question.

Colin

Colin L. wrote in post #965126:

On 30 November 2010 15:18, Albert C. [email protected] wrote:

Please don’t top post it makes it difficult to follow the thread.
Insert your comments in the previous message. Thanks.

or

src=“/////shared_dir/dir/6465_p_61_620_15674.pdf” ???

As I said in an earlier post in the thread, you can’t unless you setup
your server (apache or whatever) to serve up these files in some way.
Otherwise you must put them under the public folder.

Colin

Ok, thanks, that it was my question when i asked about a posible
solution, copy each file into public before iframe read.

Otherwise, now I’m in develpment with mongrel, so ¿do i have to
configure mongrel to serve these files?