SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Aug 18, 2006, 09:12 #1
- Join Date
- Jun 2004
- Location
- France
- Posts
- 129
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
RAILS_ROOT Problem (a different one)
Hi,
Why RAILS_ROOT returns a relative path instead of a complete one?
I thought I could use RAILS_ROOT but with something like ./script/../config/.. instead of c:/ruby/rails/project1/ it's unusable
-
Aug 18, 2006, 11:45 #2
- Join Date
- Jun 2006
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Where are you looking to use RAILS_ROOT?
I hate to say it but Dir.pwd might return what you want.
-
Aug 19, 2006, 07:40 #3
- Join Date
- Jun 2004
- Location
- France
- Posts
- 129
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I can't use Dir.pwd, I just want to get the root directory of my app, to do something like
UPLOAD_DIR = 'public/images/upload'
and add build the complete filesystem path with
complete_path = "#{RAILS_ROOT}/#{UPLOAD_DIR}"
-
Aug 19, 2006, 15:11 #4
- Join Date
- Jul 2005
- Posts
- 124
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Perhaps I'm missing something, but if you reference a directory from a controller, model, whatever without a slash in the front it starts from your Rails application's root directory.
Bookmarks