im trying to read csv file from form_tag, but when open the file with csv.read(file.path) throw the error "undefined method `path' ", someone know how to fix it?
my code in index.html.erb
<%= form_tag("/main/import",method: "get",:multipart => true,name: "hola") do %>
<%= file_field_tag :file %>
<%= submit_tag( "Import" ) %>
<% end %>
in the main controller
def import
@myfile = params[:file]
@rowarraydisp = CSV.read(@myfile.path)
end