search for: extname_dot

Displaying 2 results from an estimated 2 matches for "extname_dot".

2006 Aug 15
8
AGAIN: file object treated as string
...;].rewind File.open("pictures/upload/#{@image.id}.#{@image.extention}", "wb") { |f| f.write(uploaded_file[''picture''].read) } end end MODEL: class Image < ActiveRecord::Base def picture=(image_field) extname_dot = File.extname(image_field) self.extention = extname_dot.slice(1, extname_dot.length) self.submitDate = Time.now end end I tried implementing this with Agile web development rails book, and also tried using other examples on the web, it always c...
2006 Aug 15
0
file object treated as a string
...("pictures/upload/#{@image.id}.#{@image.extention}", "wb") { |f| f.write(uploaded_file[''picture''].read) } end end My image model looks like this: class Image < ActiveRecord::Base def picture=(image_field) extname_dot = File.extname(image_field) self.extention = extname_dot.slice(1, extname_dot.length) self.submitDate = Time.now end end When I click the submit button on the form, it saves the image entry in the database OK, but errors while trying to write the file to t...