简体   繁体   中英

how to implement Barcode generator in rails

How to generate barcode using a table id in ruby on rails. I am using Rails 5.1.4 and ruby 2.4.3. I have tried it with 'barby' gem but not sure how to mention require 'barby' and other dependencies in rails. When I am trying to enter require method in controller it is showing ' can not load barby' error.

Hi once you added gem in Gemfile and no need to require in controller in Ruby on Rails framework. Please follow the link below:

Generation bar-codes using barby

Rails在控制器中不允许使用“ require”选项,因此我在“ application.rb”中添加了所有需要的依赖项,并且对我有用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM