I know how to change a filename during the upload process using
attachment_fu, however I need to change it after the create based on
additional information I don't have during the initial upload.
Performing an attribute update on the resulting model object always
seems to ignore the "filename" attribute, but will happily update an
other attribute of the record. What gives? Is it because the record's
filename is tied to a physical file?
Code:
params[:media_file] is the ":uploaded_data" submitted by a form to the
controller.
@media_file = MediaFile.new(params[:media_file])
if @media_file.save
@media_file.update_attributes({:desc => "blah", :filename =>
"new_fname.ext"})
end
logger shows the "desc" attribute being updated but never the filename
attribute.
What gives and how can I make this happen?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.