Don't know if this is a bad practice, but how about substituting the
param value before sending it to the model?
params[:picture].merge!(:filename => 'newname') @picture = Picture.create(params[:picture])
Don't know if this is a bad practice, but how about substituting the
param value before sending it to the model?
params[:picture].merge!(:filename => 'newname') @picture = Picture.create(params[:picture])
That's right, you can't set a string into a binary field.
Read this: http://wiki.rubyonrails.org/rails/pages/HowToUseFileColumn
... and pay attention to ":multipart => true"