module Admin::GalleriesHelper def import_this_image(row,album) value = {} image = AlbumImage.new row.cells.each_with_index do |cell,index| next if cell.nil? val = cell.value next if val.nil? || val == "" case index when 0 image.remote_file_url = val when 1 value["zh_tw"] = val value["en"] = row.cells[index + 1].value rescue "" image.description_translations = value end end image.album = album image.save end end