Forum: Ruby on Rails Help on File

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Newb N. (Guest)
on 2009-02-03 08:37
Hello...

when i use below code to open a google page it works.

<INPUT type="button" value="New Window!"
onClick="window.open('http://www.google.com','mywindow','width=400,heigh...

But i have html file in my application folder.to open that file i tried
this Code.

<INPUT type="button" value="New Window!"
onClick="window.open('http://192.168.0.82:3000/ACMServer_exe/ChatHistory...

When i click this, new window opens but i get routing Error like
No route matches
"/ACMServer_exe/ChatHistory/2009-01-11/removed_email_address@domain.invalid~Vs~removed_email_address@domain.invalid/removed_email_address@domain.invalid~Vs~removed_email_address@domain.invalid"
with {:method=get}

Pls Help me .i m troubling with this for the past two days .
nothing works .pls help.how can i open local html file
Julian L. (Guest)
on 2009-02-03 08:52
(Received via mailing list)
What do you want it to do? What is the path supposed to load?

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/

On 03/02/2009, at 5:37 PM, Newb N. <rails-mailing-list@andreas-
Newb N. (Guest)
on 2009-02-03 09:01
Julian L. wrote:
> What do you want it to do? What is the path supposed to load?
>
> Blog: http://random8.zenunit.com/
> Learn rails: http://sensei.zenunit.com/
>
> On 03/02/2009, at 5:37 PM, Newb N. <rails-mailing-list@andreas-

as like google page opens ,i want to open my local file from application
folder
That HTML file's Actual path

D:\Projects\inProgress\ANGACM0908\re\Back
Ups\acm_administration-31-jan-09_2\ACMServer_exe\ChatHistory\2009-01-22\removed_email_address@domain.invalid~Vs~removed_email_address@domain.invalid\removed_email_address@domain.invalid~Vs~removed_email_address@domain.invalid
MaD (Guest)
on 2009-02-03 09:36
(Received via mailing list)
put the file in your 'public'-folder of your rails app or make it
accessible by other means (= webserver).
Julian L. (Guest)
on 2009-02-03 10:06
(Received via mailing list)
Before you do rails driven sites work out about how webservers work
first.

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/

On 03/02/2009, at 6:01 PM, Newb N. <rails-mailing-list@andreas-
Martijn Vos (Guest)
on 2009-02-03 10:29
(Received via mailing list)
On 3 Feb 2009, at 7:37 AM, Newb N. wrote:

> <INPUT type="button" value="New Window!"
> 
onClick="window.open('http://192.168.0.82:3000/ACMServer_exe/ChatHistory...
> 
~Vs~removed_email_address@domain.invalid/removed_email_address@domain.invalid~Vs~removed_email_address@domain.invalid
> ','mywindow','width=400,height=200')">

Do you see what you're doing here? You're not opening a local file,
you're asking a web server for a file. So either you need to put this
file in the public folder of your project (so the web server can find
it), configure your web server so it can find the file elsewhere, or,
if you really want the file to remain local, change the url to a local
path ("file:<full path>"). But unless this is for personal use only, I
don't think that's what you're looking for.

Then again, if this is not for personal use, you might want to learn
a bit more about web servers first.


mcv.
Newb N. (Guest)
on 2009-02-03 10:40
Martijn Vos wrote:
> On 3 Feb 2009, at 7:37 AM, Newb N. wrote:


thanks for the reply.
ok if i put my folder in public
how can i open that file.
Newb N. (Guest)
on 2009-02-03 11:25
pls kindly help me up.
Newb N. (Guest)
on 2009-02-03 11:25
pls kindly help me up.
Martijn Vos (Guest)
on 2009-02-03 16:30
(Received via mailing list)
On 3 Feb 2009, at 9:40 AM, Newb N. wrote:
> Martijn Vos wrote:
>
>> On 3 Feb 2009, at 7:37 AM, Newb N. wrote:
>
> thanks for the reply.
> ok if i put my folder in public
> how can i open that file.

Same way you'd load anything else in the public folder, like images
or css files. Take a look at an example Rails site.


mcv.
This topic is locked and can not be replied to.