Topic: file_column url in view renders a broken link

Hi,  I'm new to Ruby and Rails and I've begun developing an app to categorize and display images. I'm working on a mac with Locomotive (should be the latest version).

So it is paramount that I have an file upload mechanism that works easily.  I decided to go with file_column plugin because it looked perfect for my simple application.

I've been able to upload images without a problem. They get uploaded to a directory under app/public.  Everything seems fine until I try and see one of my uploaded images in my view. I use the following:


<%= image_tag url_for_file_column("illustration", "file_name") %>


illustration is my model object and I have other properies of illustration on the same view declared like @illustration.title.  So I do have an instance of my Illustration model object available here.

Again, everything seems to work.  A url is generated and an <img src=""> tag is created.

The problem is that the img path is broken when I look at the page in a browser.  At first I thought that the RAILS_ROOT was somehow wrong.  But I've added some extra attributes (ie. :root_path and :web_root) to my file_column declaration and it didn't help. This may all point to the fact that I don't quite understand under what context a Rails application runs.  What relationship does the app have with the public directory?  At the moment I'm just trying to display an image that has been uploaded in the app/views/show.rhtml file.

Thanks for any help!!

Re: file_column url in view renders a broken link

I have finally found out what has been happening but still don't know how to fix it.

It seems that when file_column generates the path for the image it adds a "development" directory that is not added with the uploaded image is saved.  This causes the path to be out of sync.

Anyone else had this problem?  I'm using lighttpd and I think this might be adding the development directory.

Any help would be great, thanks.


Re: file_column url in view renders a broken link

I'm experiencing the same problem. I'm using the standard Webrick server and
Rails 1.2, so it isn't the fact that you're using lighttpd.

Re: file_column url in view renders a broken link

I managed to fix the problem by getting the file column plugin again using the command:

ruby script/plugin install … lumn/trunk

The first time I installed it I was missing the /trunk on the end of the url...