Ruby on Rails #146 Generate Barcodes with JsBarcode. StimulusJS, Importmaps

4 months ago
·
stimulusjs jsbarcode importmaps

This episode is not what you expected, not what you asked for, and not what you deserve.

Previously, in episode 56, I talked about generating barcodes with gem Barby and storing them in ActiveStorage.

But really, why would you want to STORE a programatically generated file (where the result is always the same)? Why not just generate and display it on the client?

Being a Full Stack Ruby on Rails dev requires sometimes venturing into the JS world; acknowledging that it's easier to do some tasks on the client side. This is one of the cases.

Episode source code: https://github.com/corsego/146-jsbarcode-stimulus-importmaps/commit/d55bbede43fd374cd97d7a2796b609dcaaf57513
Based on this blogpost: https://blog.corsego.com/jsbarcode

0:00 Why use Javascript for Barcodes?
1:35 Auto-generate barcodes for products
3:14 use JsBarcode with importmaps and StimulusJS
6:58 customize the barcode (encoding, size, color)


3
Sign in to join the conversation

Notes to self:

  • Damn, the Recommended based on what you are watching now is messed up, because currently each video has the same 5 tags, apart of the unique tags.
  • ** Featured in playlist:** text should not display, if the video is not part of a playlist
Yaro Shm Yaro Shm 4 months ago

Note to self:

  • add markdown preview
  • add Shift+Enter combination to submit comment?
Yaro Shm Yaro Shm 4 months ago