{"action":"created","issue":{"url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/125","repository_url":"https://api.github.com/repos/zdavatz/spreadsheet","labels_url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/125/comments","events_url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/125/events","html_url":"https://github.com/zdavatz/spreadsheet/issues/125","id":58474625,"number":125,"title":"Allow access to rendered output instead of just writing a file","user":{"login":"JakeTheSnake3p0","id":6055027,"avatar_url":"https://avatars0.githubusercontent.com/u/6055027?v=4","gravatar_id":"","url":"https://api.github.com/users/JakeTheSnake3p0","html_url":"https://github.com/JakeTheSnake3p0","followers_url":"https://api.github.com/users/JakeTheSnake3p0/followers","following_url":"https://api.github.com/users/JakeTheSnake3p0/following{/other_user}","gists_url":"https://api.github.com/users/JakeTheSnake3p0/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeTheSnake3p0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeTheSnake3p0/subscriptions","organizations_url":"https://api.github.com/users/JakeTheSnake3p0/orgs","repos_url":"https://api.github.com/users/JakeTheSnake3p0/repos","events_url":"https://api.github.com/users/JakeTheSnake3p0/events{/privacy}","received_events_url":"https://api.github.com/users/JakeTheSnake3p0/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2015-02-21T20:57:03Z","updated_at":"2018-03-03T15:33:51Z","closed_at":"2015-02-23T09:27:48Z","author_association":"NONE","body":"I'm using Rails and in my controller I simply wish to output the contents of the xls file directly inside the view partial instead of using the disk and having to:\n\n1) Write the file  \n2) Read the file contents  \n3) Destroy the original file  \n4) Output the file contents\n\n---\n\ncontroller\n\n``` ruby\ndef index\n    respond_to do |format|\n      format.html\n      format.xls {\n        @workbook = Spreadsheet::Workbook.new\n      }\n    end\n  end\n```\n\napp/views/invoices/index.xls.erb\n\n``` ruby\n<%=\n\nsummary = @workbook.create_worksheet(name: 'Summary')\n# More to do here...\n\n# @stats.items => [{\n#   category => {\n#     item_name => {\n#       price => {\n#         id, inventory, quantity, tax_added, tax_included, discounts, \n#         subtotal, total, base_price, effective_base_price, \n#       }\n#     }\n#   }\n# }]\n@stats.items.each do |category|\n  ws = @workbook.create_worksheet(name: category)\n  xls_write_headings ws # helper method...\nend\n\n# This part is rather unnecessary...I should be able to do something like: @workbook.file_contents\nloc = Rails.root.join('tmp', \"invoices-#{ SecureRandom.uuid }.xls\")\n@workbook.write loc\ncontents = File.read(loc)\nFile.delete loc\ncontents\n%>\n```\n"},"comment":{"url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/comments/370156114","html_url":"https://github.com/zdavatz/spreadsheet/issues/125#issuecomment-370156114","issue_url":"https://api.github.com/repos/zdavatz/spreadsheet/issues/125","id":370156114,"user":{"login":"zdavatz","id":4953,"avatar_url":"https://avatars3.githubusercontent.com/u/4953?v=4","gravatar_id":"","url":"https://api.github.com/users/zdavatz","html_url":"https://github.com/zdavatz","followers_url":"https://api.github.com/users/zdavatz/followers","following_url":"https://api.github.com/users/zdavatz/following{/other_user}","gists_url":"https://api.github.com/users/zdavatz/gists{/gist_id}","starred_url":"https://api.github.com/users/zdavatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdavatz/subscriptions","organizations_url":"https://api.github.com/users/zdavatz/orgs","repos_url":"https://api.github.com/users/zdavatz/repos","events_url":"https://api.github.com/users/zdavatz/events{/privacy}","received_events_url":"https://api.github.com/users/zdavatz/received_events","type":"User","site_admin":false},"created_at":"2018-03-03T15:33:51Z","updated_at":"2018-03-03T15:33:51Z","author_association":"OWNER","body":"Well great :). Thank you for documenting this. "}}
{"actor":{"display_login":"zdavatz"}}