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

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -