# Access folders outside RAILS\_ROOT

**URL:** <https://www.ruby-forum.com/t/access-folders-outside-rails-root/108008>\
**Category:** Rails\
**Created:** [June 28, 2007, 11:38am UTC](https://www.ruby-forum.com/t/access-folders-outside-rails-root/108008 "2007-06-28T11:38:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrviswa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@shrviswa](https://www.ruby-forum.com/u/shrviswa)\
**Post date:** [June 28, 2007, 11:38am UTC](https://www.ruby-forum.com/t/access-folders-outside-rails-root/108008/1 "2007-06-28T11:38:29Z")

</div>

How does one make available folders outside the rails root dir? For e.g  
I want to create a folder of html pages in C:. How do I make this  
accessible to users of my Rails server?

---

<div class="post-metadata">

**Author:** ![shrviswa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@shrviswa](https://www.ruby-forum.com/u/shrviswa)\
**Post date:** [June 28, 2007, 1:36pm UTC](https://www.ruby-forum.com/t/access-folders-outside-rails-root/108008/2 "2007-06-28T13:36:13Z")

</div>

Dear Shruthi,

This is basically a bad idea from a security viewpoint. It is  
possible from Rails, but it is not a good idea and so, like all not so  
good ideas, Rails makes it harder for you.

“The usual is easy, the uncommon is possible… but not always easy”.

Doing this is actually not so hard, and is actually a web server  
issue, not a rails issue. Rails handles the rendering of your rails  
pages out of the RAILS\_ROOT/public directory.

Your BEST bet is to move those files out of C and put them somewhere  
that your normal webserver can get to them. But NOT in the root  
directory.

If you put it in the root directory, you open up the ability for  
people to go [http://your.url.com/windows/server\_password\_file.txt](http://your.url.com/windows/server_password_file.txt)

You get the idea

So you need to really go into your web server and find out what you  
need to do, it is not so much rails.

Unless you are trying to get rails to send files to the users using  
send\_file or something in which case, just type the path in the  
send\_file param. Start it with a / and you will get the root dir.

ARC

Mikel

---

<div class="post-metadata">

**Author:** ![shrviswa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@shrviswa](https://www.ruby-forum.com/u/shrviswa)\
**Post date:** [June 28, 2007, 2:40pm UTC](https://www.ruby-forum.com/t/access-folders-outside-rails-root/108008/3 "2007-06-28T14:40:23Z")

</div>

Thanks a lot for the info, Mikel. I think I worded my question wrongly.  
I just want to render HTML pages stored in a folder which is not under  
RAILS\_ROOT/public directory, but is elsewhere, like C:\abcd. So all I  
want to do is switch the context from RAILS\_ROOT to the other folder, to  
display the static HTML pages. I dont think there’s any security threat  
in this case. How exactly do I do this?
