11155
(-- --)
November 23, 2010, 3:52pm
1
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?
Colin_Law1
(Colin Law)
November 23, 2010, 4:21pm
2
By putting the file in your_app/public/documentation. Then your link
will find it.
Colin
11155
(-- --)
November 23, 2010, 5:26pm
3
Colin Law 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?
Colin_Law1
(Colin Law)
November 23, 2010, 5:34pm
4
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
11155
(-- --)
November 30, 2010, 2:09pm
5
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?
11155
(-- --)
November 30, 2010, 2:42pm
7
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
<iframe src="public/6465_p_61_620_15674.pdf"></iframe>
¿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
Colin_Law1
(Colin Law)
November 30, 2010, 2:55pm
8
if it is in the public folder of your app then you just want
src="/6465_p_61_620_15674.pdf".
Colin
11155
(-- --)
November 30, 2010, 3:11pm
9
Ok, don't panicm another wat to make the question:
id DreamWeaver i can do:
<iframe
src="file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf"></iframe>
but in a ruby form (_frame_pdf.html.erb) i Can not do the same
<iframe
src="file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf"></iframe>
If i inspect FireBug i get:
"try {
Element.update("frame_oc", " <iframe
src=\"file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf\"></iframe>\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\\\"></iframe>\\n\");');
throw e }"
11155
(-- --)
November 30, 2010, 3:18pm
10
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
Colin_Law1
(Colin Law)
November 30, 2010, 3:23pm
11
Please don't top post it makes it difficult to follow the thread.
Insert your comments in the previous message. Thanks.
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" ???
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
11155
(-- --)
November 30, 2010, 3:32pm
12
Colin Law wrote in post #965126:
Colin_Law1
(Colin Law)
November 30, 2010, 3:41pm
13
No idea sorry, I think you would have to ask that on a Mongrel list.
It is not a Rails question.
Colin