Topic: Barcode Generator (Matsimitsu's): NoMethodError

I'm using Matsimitsu's Barcode Generator:

http://github.com/matsimitsu/barcode-generator

and have installed: gbarcode (0.98.16), rmagick (2.12.2) and have installed the files to: Vendor/Plugins/ directory and successfully ran the rake barcode_setup command to create the public/images/barcodes dir.

I Tried using the sample code: <%= barcode 'FJJ4JD'%> in one of my html.erb files, with the returned message:

-------------------------------------------------------------------------------------------------------
NoMethodError in Inventories#show
undefined method `barcode' for #<ActionView::Base:0x105bb8838>
Extracted source (around line #41):

38:   <%=h @inventory.campus %>
39: </p>
40:
41: <%= barcode 'TEST1234'%>
42:
43:
44: <%= link_to 'Edit', edit_inventory_path(@inventory) %> |
RAILS_ROOT: /Users/justinz/barcode

Application Trace | Framework Trace | Full Trace
app/views/inventories/show.html.erb:41:in `_run_erb_47app47views47inventories47show46html46erb'
app/controllers/inventories_controller.rb:26:in `show'

-------------------------------------------------------------------------------------------------------
Did I install this incorrectly? Am I using this incorrectly?

Any help would be GREATLY Appreciated

Thank you in advance Google Ruby on Rails Talk Folks!

JZ

Re: Barcode Generator (Matsimitsu's): NoMethodError

Hi !
You want to generate a barcode inside a pdf, right?

I think you are not doing the right way:
you need invoke it to inside a prawnto view, not in a erb view

You will have to install first the Prawn gem and the prawnto plugin

Please check this article that might help you:
http://blog.matsimitsu.nl/ruby-on-rails … -generator

Then follow up with Prawn / prawnto documentation

May this help
Bruno

Re: Barcode Generator (Matsimitsu's): NoMethodError

Which platform would you like to create barcode in? Java or .NET? If you want to create barcode in Java, you may take a look at this
Java barcode generator library. If you want to create barcode in .NET, you may take a look this .NET barcode generator library
. Hope it's helpful.