Skip to content

Instantly share code, notes, and snippets.

@owalacesilva
Last active June 14, 2023 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owalacesilva/a578d735004c79aeda93a24249a2192f to your computer and use it in GitHub Desktop.
Save owalacesilva/a578d735004c79aeda93a24249a2192f to your computer and use it in GitHub Desktop.
def read_file
## ActionDispatch::Http::UploadedFile
uploaded_file = params[:file]
File.open(uploaded_file.path, "r") do |f|
words = []
f.each_line do |line|
words << line.split
end
words
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment