# File\_column plugin. Storing files outside RAILS\_ROOT

**URL:** <https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444>\
**Category:** Rails\
**Created:** [June 28, 2006, 8:28pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444 "2006-06-28T20:28:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 8:28pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/1 "2006-06-28T20:28:39Z")

</div>

I also posted this on Rails Engines forum. Sorry for the double post.

I am trying to configure file\_column plugin so that it stores the images  
in a directory completely outside of RAILS\_ROOT.  
I have no problems in storing the files by setting :root\_path option.  
But I can’t get to display these images using ‘url\_for\_file\_column’.  
What I get instead of the image is simply the filename.  
Is this a bug in the plugin or am I not using it properly?

Thanks in advance,  
Cagan

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/2 "2006-06-28T20:49:14Z")

</div>

Can you get it working when the image is inside the rails root? I’ve  
never used the plugin (yet), but my guess is that this could be a good  
indicator whether you’ve been doing something wrong or the plugin just  
can’t handle images being stored anywhere else.  
-Nathan

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 8:52pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/3 "2006-06-28T20:52:15Z")

</div>

unknown wrote:

> Can you get it working when the image is inside the rails root? I’ve  
> never used the plugin (yet), but my guess is that this could be a good  
> indicator whether you’ve been doing something wrong or the plugin just  
> can’t handle images being stored anywhere else.  
> -Nathan

Hi Nathan,  
yes it works when the image is inside the rails root.  
Thanks,  
Cagan

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 9:11pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/4 "2006-06-28T21:11:46Z")

</div>

Andrew S. wrote:

> > > I have no problems in storing the files by setting :root\_path option.
> 
> I had a similar issue using the :store\_dir. I updated the  
> url\_for\_file\_column method to use the :store\_dir option defined in the  
> class. I sent it to the author of file\_plugin as well as posting the  
> modification to:
> 
> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn)
> 
> You’ll need to modify this further to use the :root\_path setting.
> 
> It may not be the ideal fix, but found that it worked for what I needed.

I commented out the original method and replaced it with your method in  
file\_method\_helper.rb.  
I get a ‘NoMethodError undefined method `/opt/wwz/user/image\_path’ for  
#User:0x22df05c’  
on the following line:  
return object.send(options[:store\_dir]) \<\< relative\_path

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/5 "2006-06-28T20:59:55Z")

</div>

> > I have no problems in storing the files by setting :root\_path option.

I had a similar issue using the :store\_dir. I updated the  
url\_for\_file\_column method to use the :store\_dir option defined in the  
class. I sent it to the author of file\_plugin as well as posting the  
modification to:

[http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn](http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn)

You’ll need to modify this further to use the :root\_path setting.

It may not be the ideal fix, but found that it worked for what I needed.

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/6 "2006-06-28T21:55:07Z")

</div>

just use a symbolic link inside rails…

cagan senturk schrieb:

---

<div class="post-metadata">

**Author:** ![cagan327](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@cagan327](https://www.ruby-forum.com/u/cagan327)\
**Post date:** [June 28, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/file-column-plugin-storing-files-outside-rails-root/96444/7 "2006-06-28T21:57:56Z")

</div>

Pete wrote:

> just use a symbolic link inside rails…
> 
> cagan senturk schrieb:

yes that’s exactly what I ended up doing at the end…  
Thanks,  
Cagan
