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.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-03 07: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/parthiban@angleritech.com~Vs~joy@angleritech.com/jayabharathy@angleritech.com~Vs~kannan@angleritech.com.html"
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
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-02-03 07: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 Newb <rails-mailing-list@andreas-
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-03 08:01
Julian Leviston 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 Newb <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\martin@angleritech.com~Vs~joy@angleritech.com\jayabharathy@angleritech.com~Vs~kannan@angleritech.com.html
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-03 08:36
(Received via mailing list)
put the file in your 'public'-folder of your rails app or make it
accessible by other means (= webserver).
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-02-03 09: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 Newb <rails-mailing-list@andreas-
C36cc320477e8d66a984bb0581449ad1?d=identicon&s=25 Martijn Vos (Guest)
on 2009-02-03 09:29
(Received via mailing list)
On 3 Feb 2009, at 7:37 AM, Newb Newb wrote:

> <INPUT type="button" value="New Window!"
> 
onClick="window.open('http://192.168.0.82:3000/ACMServer_exe/ChatHistory...
> ~Vs~joy@angleritech.com/jayabharathy@angleritech.com~Vs~kannan@angleritech.com.html
> ','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.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-03 09:40
Martijn Vos wrote:
> On 3 Feb 2009, at 7:37 AM, Newb Newb wrote:


thanks for the reply.
ok if i put my folder in public
how can i open that file.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-03 10:25
pls kindly help me up.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-03 10:25
pls kindly help me up.
C36cc320477e8d66a984bb0581449ad1?d=identicon&s=25 Martijn Vos (Guest)
on 2009-02-03 15:30
(Received via mailing list)
On 3 Feb 2009, at 9:40 AM, Newb Newb wrote:
> Martijn Vos wrote:
>
>> On 3 Feb 2009, at 7:37 AM, Newb Newb 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.