Rails: Send a file generated by an axlsx view to a model
问题 I am using the axlsx gem to generate excel spreadsheets. I am trying to send the generated spreadsheet to the model for zipping. This method zips the excel file with some other files. The method in my model looks like this: def zipper tempfile = Tempfile.new children = self.children_with_forms Zip::OutputStream.open(tempfile) do |stream| children.each do |child| directory = "#{child.wide_reference[0,3]}/" if child.model_name == "Position" stream.put_next_entry("#{child.volume} #{child.title}