physical path the public directory

0 views
Skip to first unread message

eggie5

unread,
Sep 3, 2007, 5:19:32 PM9/3/07
to Ruby on Rails: Talk
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

Neeraj Kumar

unread,
Sep 3, 2007, 5:47:50 PM9/3/07
to rubyonra...@googlegroups.com
RAILS_ROOT/public

uncle

unread,
Sep 3, 2007, 6:01:34 PM9/3/07
to Ruby on Rails: Talk
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"

Reply all
Reply to author
Forward
0 new messages