File_column

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.

On 1/4/06, Alexander A. [email protected] 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

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

Alexander A.
Information Systems Department
Mediterranean Agronomic Institute of Chania
Tel.: +30 28210 35000 718
Email: [email protected]

On 1/4/06, Alexander A. [email protected] 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

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

Alexander A.
Information Systems Department
Mediterranean Agronomic Institute of Chania
Tel.: +30 28210 35000 718
Email: [email protected]