Ruby on Rails

Sdílet
Vložit
  • čas přidán 8. 05. 2024
  • 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: github.com/corsego/146-jsbarc...
    Based on this blogpost: 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)

Komentáře • 4

  • @ledockol
    @ledockol Před 6 měsíci +1

    Ох, як зручно! Мінімум кода і повністю робочий функціонал.
    Дякую, Ярослав!
    Слава Україні!

  • @paketankampus1663
    @paketankampus1663 Před 6 měsíci +1

    great! now we need barcode scanner for that

  • @remotronic
    @remotronic Před 6 měsíci +1

    👍

  • @hakroot7863
    @hakroot7863 Před 6 měsíci +1

    👨‍💻🫡🙏