When I am creating a model, everything works but not during update
(where I use Model.update_attributes(model_attributes) ).
I get the error:
Do not know how to handle a string with value ‘image_xxx.jpg’ that was
passed to a file_column. Check if the form’s encoding has been set to
‘multipart/form-data’.
The form is indeed multipart. Does file_column work with
update_attributes? In the server log I see message:
script/server: No such file or directory - file -bi
“./script/…/config/…/publi
c/temple/image1/tmp/1145739576.129000.3652/image_xxx.JPG”
but the image is there in
/public/temple/image1/tmp/1145739576.129000.3652/ folder.
The problem has to do with my update method in the controller. I was
doing a find_by_id
in my update and then setting the attributes. This was followed later by
call to update_attributes like below:
If I take out the call to @temple.attributes = params[:temple]
and replace it with @temple.update_attributes(params[:temple)
things are working. So seems like I need to rework my update method
impl.
Navjeet C. wrote:
When I am creating a model, everything works but not during update
(where I use Model.update_attributes(model_attributes) ).
I get the error:
Do not know how to handle a string with value ‘image_xxx.jpg’ that was
passed to a file_column. Check if the form’s encoding has been set to
‘multipart/form-data’.
The form is indeed multipart. Does file_column work with
update_attributes? In the server log I see message:
script/server: No such file or directory - file -bi
“./script/…/config/…/publi
c/temple/image1/tmp/1145739576.129000.3652/image_xxx.JPG”
but the image is there in
/public/temple/image1/tmp/1145739576.129000.3652/ folder.
What could be going wrong here?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.