How, from my controller, can I get the filesystem path to my rails app''s ''public directory''? e.g.: /users/eggie5/sites/rails_app/public --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
RAILS_ROOT/public On 9/3/07, eggie5 <eggie5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > How, from my controller, can I get the filesystem path to my rails > app''s ''public directory''? e.g.: > > /users/eggie5/sites/rails_app/public > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sometimes I want/need an absolute path, so I add this to my config/
environment.rb
RAILS_FULL_ROOT = Pathname.new(RAILS_ROOT).realpath.to_s
the public directory is then
public = "#{RAILS_FULL_ROOT}/public"
On Sep 3, 4:19 pm, eggie5 <egg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> How, from my controller, can I get the filesystem path to my rails
> app''s ''public directory''? e.g.:
>
> /users/eggie5/sites/rails_app/public
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---