README.md in br_danfe-0.14.5 vs README.md in br_danfe-0.15.0
- old
+ new
@@ -43,9 +43,25 @@
send_data danfe.render_pdf, filename: "danfe.pdf", type: "application/pdf"
end
end
+#### Usage in Rails Controller with more than one xml
+ class DanfeController < ApplicationController
+ def new
+ invoices = Invoice.where(ids: params[:ids])
+ xmls_as_string = []
+
+ invoices.each do |invoice|
+ xmls_as_string << invoice.generate_xml # your method that generates the NF-e's xml
+ end
+
+ danfe = BrDanfe::Danfe.new(xmls_as_string)
+
+ send_data danfe.render_pdf, filename: "danfe.pdf", type: "application/pdf"
+ end
+ end
+
### Options
* `logo_path`: Path of sender's logo image.
* `logo_dimensions`: Dimensions of the logo. Ex: logo_dimensions = { width: 100, height: 90 }