rails import csv data from dynamic url -


i'm newbie ror. i'm trying import data asp url: i've ticket passed url returns informations time_created, time_updated, owner, notes. i've tried putting code in view:

<% file = open("http://xxx.xxx.xxx/utility/ticket_dettagli.asp?tt="+@ticket.ticket) %>  <%= csv.new(file, col_sep: ',').readlines |row| %>    <%= ticket.create! row.to_hash %> <% end %> 

without success...any suggestion?

why trying in view? think, there should rake task import tickets form csv or class method in model ...

see: http://railscasts.com/episodes/396-importing-csv-and-excel

@ticket - variable? how declare it?


Comments

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -