File_column mangling URL

Hey,

I’ve gotten file_column to upload a file, drop it in the dynamic
directory, but I can’t display the image, the directories repeat
themselves:

My model:

class Person < ActiveRecord::Base
file_column :image_url

In my view:

<%= image_tag url_for_file_column(‘person’, ‘image_url’) %>

HTML generated is this:

Male_face

There shouldn’t be two ‘/dhcp/public’ there.

  • Nic

On 1/16/06, Nic W. [email protected] wrote:

  • Nic

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

I know that with the addition of named routes, Rails uses xxxx_url,
and possibly either reserves it, or attaches magic functionality.
What happens when you rename your field?


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
[email protected]
1-866-263-3261

Thanks, that fixed part of the problem - I can use image_tag, but not
the url_for_file_column version:

<%= image_tag(@person[‘image’]) %> *** WORKS ***
<%= image_tag url_for_file_column(‘person’, ‘image’) %> *** SAME PROBLEM


I guess I’ll just use the original image_tag, thanks!

  • Nic.

On 1/16/06, Kyle M. [email protected] wrote:

    file_column      :image_url

There shouldn’t be two ‘/dhcp/public’ there.
and possibly either reserves it, or attaches magic functionality.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

  • Nic

Actually, that doesn’t work, because image_tag just looked in /images,
where I happened to have the same jpg.

I need to use image_tag url_for_file_column to point to the dynamic
directory, but it repeats the /dhcp/public twice:

Werner

Anybody have any thoughts?

On 1/16/06, Nic W. [email protected] wrote:

On 1/16/06, Kyle M. [email protected] wrote:

    file_column      :image_url

There shouldn’t be two ‘/dhcp/public’ there.
and possibly either reserves it, or attaches magic functionality.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

  • Nic

  • Nic

Hey Nic,

On 1/17/06, Nic W. [email protected] wrote:

<%= image_tag url_for_file_column(‘person’, ‘image_url’) %>

HTML generated is this:

Male_face

There shouldn’t be two ‘/dhcp/public’ there.

Is your rails app deployed at a sub-path (e.g., not directly at
top-level)? file_column has some issues here, that I’m currently
working on (Ara did some debugging, I just have to catch up).

Sebastian

Hey Sebastian,

It is displayed at sub-path, meaning I have WebRoot as the top level
for Apache, and then the app ‘dhcp’ is off of that, making it:

/dhcp/public/person/image/1/male_face.jpg

Is that what you’re referring to?

Thanks for the response, this has been holding me back. I’ll try
pointing Apache at the app and see if that makes a difference

  • Nic.

On 1/18/06, Sebastian K. [email protected] wrote:

    file_column      :image_url

There shouldn’t be two ‘/dhcp/public’ there.

  • Nic