Permalink
Browse files

making sure there is a DOM friendly selector for your barcodes.

  • Loading branch information...
perezd committed Feb 18, 2010
1 parent c9ddf20 commit de5ac2364a0b5c5fc6824b2c591de24d92d61878
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/barcoder.rb
View
@@ -65,15 +65,15 @@ def barcode_to_disk(data, barcode, output_format)
File.open("#{BARCODE_STORAGE_PATH}/#{filename}", 'w') do |f|
f.write(data)
end
- image_tag("barcodes/#{filename}")
+ image_tag("barcodes/#{filename}", :id => "barcode", :class => "barcode")
end
# stream the barcode to the client as a data url. often times, the barcode
# filesize is so minute, that this is absolutely acceptable. NOTE: I intentionally
# draw my own img tag for this, image_tag doesn't really like this.
def barcode_to_stream(data, format, str)
src = "data:image/#{format};base64,#{Base64.encode64(data)}"
- %Q{<img src="#{src}" alt="#{str}" />}
+ %Q{<img src="#{src}" alt="#{str}" id="barcode" class="barcode" />}
end
# this method tricks GBarcode into printing the contents of the EPS into

0 comments on commit de5ac23

Please sign in to comment.