Hello, i’m using the very popular attachment_fu plugin, almost
everything is awesome.
But I spend all day to make attachment_fu update a existing file with
I’m doing simple upload where my model product has_one
product_image(another model), in this product_image i call
has_attachment and everything works fine for new products. But when i
try update a product record and his image i get the error: undefined
method `uploaded_data=’ for #Product:0x679c664 , i thinking
update_attributes doesn’t work in attachment_fu when use associations.
I can’t do this, because my new.html.erb is a view for product model
and not for product_image, this is the reason for uploaded_picture=
And the problem not is when call new but update and uploaded_picture
is used only in new.
I think the reason is because updated_data is a method for
product_image class, but even i use <%= f.file_field :uploaded_picture
%>(field for my virtual atribute uploaded_picture) in my edit view i
got errors, but this error:
undefined method `content_type’ for “Fotos-132.jpg”:String
Some one can help? How can i update existing attachment when this file
is stored in diferent table and associated with other table?
I bought Advanced Rails recipes but the chapter about upload had the
I’ve just installed this plugin and I have problem with using with
Urls are created in that way
instead of :
I can fix it manually in this place but I’m not sure if it will work
properly at all.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.