Sam Donaldson
2006-May-10 02:32 UTC
[Rails] getting absolute paths on files on filesystem.
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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/c237276b/attachment.html
On 5/10/06, Sam Donaldson <samonderous@gmail.com> 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. > _______________________________________________ > 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
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 -- Posted via http://www.ruby-forum.com/.