# File\_column

**URL:** <https://www.ruby-forum.com/t/file-column/89330>\
**Category:** Rails\
**Created:** [January 4, 2006, 9:02am UTC](https://www.ruby-forum.com/t/file-column/89330 "2006-01-04T09:02:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![motoris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@motoris](https://www.ruby-forum.com/u/motoris)\
**Post date:** [January 4, 2006, 9:02am UTC](https://www.ruby-forum.com/t/file-column/89330/1 "2006-01-04T09:02:41Z")

</div>

I use file\_column and it works fine.  
I tried to change the store\_dir to a the path I want my files to be  
stored and not the default.  
I stored some images fine. But when I try to reach my images it seems  
like file\_column uses the model\_name/attribute\_name on the image and not  
the store\_dir I used. How can I change this ?  
Thanks in advance

–  
Alexander A.

---

<div class="post-metadata">

**Author:** ![motoris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@motoris](https://www.ruby-forum.com/u/motoris)\
**Post date:** [January 4, 2006, 6:12pm UTC](https://www.ruby-forum.com/t/file-column/89330/2 "2006-01-04T18:12:42Z")

</div>

On 1/4/06, Alexander A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I use file\_column and it works fine.  
> I tried to change the store\_dir to a the path I want my files to be  
> stored and not the default.  
> I stored some images fine. But when I try to reach my images it seems  
> like file\_column uses the model\_name/attribute\_name on the image and not  
> the store\_dir I used. How can I change this ?

this should work by setting the :store\_dir option like this.

file\_column :image, :store\_dir =\> “/some/path/on/your/disc”

However, your e-mail sounds as if you’ve already been aware of this?

Hope this helps  
Sebastian

---

<div class="post-metadata">

**Author:** ![motoris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@motoris](https://www.ruby-forum.com/u/motoris)\
**Post date:** [January 4, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/file-column/89330/3 "2006-01-04T18:14:34Z")

</div>

Yes I have set the :store\_dir to where I want my images to be stored but  
not as a full path.

Sebastian K. wrote:

> this should work by setting the :store\_dir option like this.  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)  
> –  
> Alexander A.  
> Information Systems Department  
> Mediterranean Agronomic Institute of Chania  
> Tel.: +30 28210 35000 718  
> Email: removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![motoris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@motoris](https://www.ruby-forum.com/u/motoris)\
**Post date:** [January 4, 2006, 10:25pm UTC](https://www.ruby-forum.com/t/file-column/89330/4 "2006-01-04T22:25:09Z")

</div>

On 1/4/06, Alexander A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yes I have set the :store\_dir to where I want my images. I tried with  
> the full path of the folder also but url\_for\_image\_column always returns  
> the model\_name/attribute\_name (which is image/image in my case) and not  
> the actuall store image\_path.

ahh. Yes, url\_for\_file\_column has no idea how to access the path you  
gave to :store\_dir via an URL. If you set the :base\_url option to the  
URL at which the directory in :store\_dir can be reached,  
url\_for\_file\_column should work.

Sebastian

---

<div class="post-metadata">

**Author:** ![motoris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@motoris](https://www.ruby-forum.com/u/motoris)\
**Post date:** [January 4, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/file-column/89330/5 "2006-01-04T18:14:34Z")

</div>

Sorry I sended the mail unfinished …  
Yes I have set the :store\_dir to where I want my images. I tried with  
the full path of the folder also but url\_for\_image\_column always returns  
the model\_name/attribute\_name (which is image/image in my case) and not  
the actuall store image\_path.

Sebastian K. wrote:

> this should work by setting the :store\_dir option like this.  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)  
> –  
> Alexander A.  
> Information Systems Department  
> Mediterranean Agronomic Institute of Chania  
> Tel.: +30 28210 35000 718  
> Email: removed\_email\_address@domain.invalid
