+ previous = SkinPicture.find(:first,
+ :conditions => ["filename = ?", @election.embed_custom_string + "bg1.png"])
+ if previous
+ previous.destroy
+ end
+ bg1 = SkinPicture.new(params[:bg1])
+ bg1.filename = prefix + "bg1." + params[:bg1][:uploaded_data].content_type[6..-2]