Hi,
Sebastian K. of the file_column-Plugin wrote once:
“is the photo object inside a local variable or an instance variable
(e.g. photo or @photo)? url_for_file_column only works with instance
variables, like all other active record form helpers. Could this be
the problem?”
So I’m using file_column in a partial, e.g.
<%= render (:partial => “product”, :collection => @products) %>
my partial (_product.rhtml) looks like this:
<%= link_to product.titel, :action => 'detail', :id => product.id %>
<%= link_to (image_tag url_for_file_column("product", "image"), {:width => '150', :height => '181', :style => ""}), { :action => 'detail', :id => product.id }, {:title => "Detailansicht" } %><%= product.preis %>
But in my partial I have the local variable “product”, not the
instance variable @product, so file_column doesn’t work. I now have a
<% @product = product %>
in the top of my partial, but I think there must be a more railish way.
But how?
Thanks,
Beate