it's basically a bad idea, to create paths like this:
"#{RAILS_ROOT}/<%=@f.content_path%>"
use the File.join method instead
File.join(RAILS_ROOT, @f.content_path)
this will save you a lot of trouble with missing slashes etc.
#{RAILS_ROOT}/E:/project_name/public/folder_name/id/file.mpg
cant work
assume a windows machine and your project is:
C:\projects\myproject
which is rails_root then
it's basically a bad idea, to create paths like this:
"#{RAILS_ROOT}/<%=@f.content_path%>"
use the File.join method instead
File.join(RAILS_ROOT, @f.content_path)
this will save you a lot of trouble with missing slashes etc.
#{RAILS_ROOT}/E:/project_name/public/folder_name/id/file.mpg
cant work
assume a windows machine and your project is:
C:\projects\myproject
which is rails_root then
that's not a valid path, eg because of the two discs C: E: and the mix
of slashes/backslashes
what kind of OS are you using, since the drive letters would be Windows
like, but you use the slashes like for unix or mac?
i am using windows xp
basically #{RAILS_ROOT} will take the path where the project will be.so
in my task if i give
#{RAILS_ROOT}\@f.content_path means it should show the path like
\public\folder_name\id\file.mpg right? but instead it shows the path as
E:\project_name\public\folder_name\id\file.mpg. how to solve this
problem..
Um no. RAILS_ROOT is the location on disk of your rails app, ie E:\project_name in your case.
I've no idea what f and its content_path method are, but what you want to give to the user's browser is a path relative to the public/ folder in your rails app