Forum: Ruby on Rails file_column

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D825f1046cfb8c49f667395a78c2beda?d=identicon&s=25 Alexander Antonakakis (Guest)
on 2006-01-04 09:02
(Received via mailing list)
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 Antonakakis
B8ed55487e4f2f0feaeb68957dc07b21?d=identicon&s=25 Sebastian Kanthak (Guest)
on 2006-01-04 18:12
(Received via mailing list)
On 1/4/06, Alexander Antonakakis <alexis@maich.gr> 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
D825f1046cfb8c49f667395a78c2beda?d=identicon&s=25 Alexander Antonakakis (Guest)
on 2006-01-04 18:14
(Received via mailing list)
Yes I have set the :store_dir to where I want my images to be stored but
not as a full path.

Sebastian Kanthak wrote:
> this should work by setting the :store_dir option like this.
> http://lists.rubyonrails.org/mailman/listinfo/rails
--
Alexander Antonakakis
Information Systems Department
Mediterranean Agronomic Institute of Chania
Tel.: +30 28210 35000 718
Email: alexis@maich.gr
D825f1046cfb8c49f667395a78c2beda?d=identicon&s=25 Alexander Antonakakis (Guest)
on 2006-01-04 18:14
(Received via mailing list)
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 Kanthak wrote:
> this should work by setting the :store_dir option like this.
> http://lists.rubyonrails.org/mailman/listinfo/rails
--
Alexander Antonakakis
Information Systems Department
Mediterranean Agronomic Institute of Chania
Tel.: +30 28210 35000 718
Email: alexis@maich.gr
B8ed55487e4f2f0feaeb68957dc07b21?d=identicon&s=25 Sebastian Kanthak (Guest)
on 2006-01-04 22:25
(Received via mailing list)
On 1/4/06, Alexander Antonakakis <alexis@maich.gr> 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
This topic is locked and can not be replied to.