Forum: Ruby on Rails getting absolute paths on files on filesystem.

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.
036be8d5d83a98e546b98d64e3fd6c20?d=identicon&s=25 Sam Donaldson (Guest)
on 2006-05-10 04:34
(Received via mailing list)
Hi,

I'd like to be able to store the absolute path for a file so that I
could
use <img src = "...." > and give it the path to the file I'd like to
display.  I was wondering if there is an easy way to do this and whether
there are any issues with this on Windows.

thanks in advance.
B780ee0ee1480454a85df58536702f63?d=identicon&s=25 Alder Green (Guest)
on 2006-05-10 07:58
(Received via mailing list)
On 5/10/06, Sam Donaldson <samonderous@gmail.com> wrote:
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>

Check out the 'uri' and 'pathname' libraries that are part of Ruby's
stdlib.

IIRC, there are some issues on the latest version (1.8.4) with some
Windows paths. Generally, workarounds are available.

-Alder
807e34b31d5463a9ac05d41458a9e537?d=identicon&s=25 Al Evans (al-evans)
on 2006-05-10 14:14
Sam Donaldson wrote:
> Hi,
>
> I'd like to be able to store the absolute path for a file so that I
> could
> use <img src = "...." > and give it the path to the file I'd like to
> display.  I was wondering if there is an easy way to do this and whether
> there are any issues with this on Windows.
>
> thanks in advance.

AS far as I know, this won't do you any good. What you need is not the
absolute path, but the path in relation to the public directory.

--Al Evans
This topic is locked and can not be replied to.