I am trying to use file column to update a record that is already
created in the DB. Here is how things work. I allow the user to
create a new Entry dynamically. That entry can have an image
associated so i build a form that allows the user to upload an image.
The image upload is passed to a action that is supposed to update the
image column but nothing ever happens. I know this is an ignorant
question fairly new to rails and this is one of the last things I
need to add to my app that is base functionailty. From here it is all
some advanced work and cleanup.
Sorry for the dumb question I know that this is probably me just
staring at the code for to long and I am going to slap myself when i
get this working.
You should say @entry.update_attributes(params[:entry]), here, I
believe. If you look at the code generated by your view, you’ll see
that the image upload field is named “entry[image]” and another hidden
field “entry[image_temp]”.
Ok one more dumb question and this one I feel real stupid about. I am
able to get the app to create the temp directory when I select an
image to upload however I get a
undefined method `original_filename’ for
{“image_temp”=>""}:HashWithIndifferentAccess
I noticed in the doc that under the rails_file_column.rb file it says
require this file in your environment.rb file. I have tried every
combination I can think of and either I get a 500 server error or I
get the above error again. I made the change to the controller as
Sebastion mentioned and have only gotten this far. When I originally
installed file_column the directory in the vendor/plugin directory
was called trunk. I have left it that way as well as changed it to
read file_column and tried every other thing I know of. Is it this
require issue or is something else missing?
Ok one more dumb question and this one I feel real stupid about. I am
able to get the app to create the temp directory when I select an
image to upload however I get a
undefined method `original_filename’ for
{“image_temp”=>""}:HashWithIndifferentAccess
I noticed in the doc that under the rails_file_column.rb file it says
require this file in your environment.rb file. I have tried every
combination I can think of and either I get a 500 server error or I
get the above error again. I made the change to the controller as
Sebastion mentioned and have only gotten this far. When I originally
installed file_column the directory in the vendor/plugin directory
was called trunk. I have left it that way as well as changed it to
read file_column and tried every other thing I know of. Is it this
require issue or is something else missing?
Andrew
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.