I’am creating an image uploading system for advertise site in Rails
Using receipt 57 from the book rails recipies.
1 action give different returns in safari and Firefox
def file_data=(file_data)
if file_data.blank?
else
@file_data = file_data
write_attribute ‘extension’ ,
file_data.original_filename.split( ‘.’ ).last.downcase
end
end
when a create an advert in Safari without an image the file_date.blank?
works well and i can save my advert without an picture.
But firefox ignores the file_data.blank? so i get an no method error
#You have a nil object when you didn’t expect it!
#The error occured while evaluating nil.downcase
#{RAILS_ROOT}/app/models/advert.rb:51:in file_data=' #{RAILS_ROOT}/app/controllers/home_controller.rb:111:in
createadvert’
Firefox ignores the if file_data.blank?
How can i made that both browsers do the same thing and works Ie the
same like fireox in this case