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!!