The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
I recently found myself wanting to be alerted on an unselect action so that I could change what was displayed on the page. A small Stimulus controller that waits for the selection event, and emits its own event that other radio button controllers will receive was the perfect solution! https://onrails.blog/2020/09/25/radio-selection-unselect/
I just published a story about how I lost my website domain, what was happened with it and how I have relaunched my website. https://medium.com/@mayurt20/how-i-have-relaunched-my-website-bb63412c2c03
Learn more about how to sort records in custom order by enum value in rails. Contact us to build web and mobile app to add value to business. https://www.botreetechnologies.com/blog/how-to-sort-records-in-custom-order-by-enum-value-in-rails
Starting with this release we are publishing official docker images for ActiveWorkflow to DockerHub. Now you can start using ActiveWorkflow without ever touching the source code repository (unless you want to). [more inside]
I wrote a a post on how I optimise images uploaded with ActiveStorage by reducing resolution and applying some compression optimisations. The result is a smaller file without sacrificing much in quality. [more inside]
Packwerk is a Ruby gem created at Shopify that can be used to enforce boundaries and modularize Rails applications. Try it out yourself by running
packwerk init in the application after installing it.
A Gem for working with Waveshare’s PN532 NFC HAT for Raspberry Pi. Wraps C code for quick execution, and comes with extras to get you started with it out of the box. Read about it on my website or check out the code on GitHub
Ruby on Rails is one of the web development frameworks for building web applications. Even though Ruby on Rails has reached its maturity, https://www.business2community.com/ecommerce/why-ruby-on-rails-is-perfect-for-ecommerce-web-development-in-2020-02347634
The RubyGem ecosystem, famous for gems like Rails for web development, Devise for authentication, and Pundit for authorization, enables productivity via code reuse. As such, it is great for quickly adding libraries to your project to automate part of the work or reuse other people’s solutions to solved problems. That said, you wouldn’t want to package extremely large files like the OpanAI 1GB+ files in a RubyGem. Enter bundler-download, a Bundler Plugin that enables downloading extra gem files after installing with
bundle install by declaring gem downloads in a
Authentication in Rails application by Devise https://fullstackrubyonrails.com/blog/authentication-in-rails-application
A simple way to write RSpec tests that assert an exception is raised and changes are rolled back.
case_register is a gem that provides a design pattern to manage switch statements by mapping each case to a method which is dynamically defined in advance.
If you’ve ever had a need to implement an audit log to track all the changes that get persisted for all or at least some models in your application, there is a good chance that you’ve encountered PaperTrail gem that makes it trivial to track all the changes - it might be as easy as adding
has_paper_trail to the desired models. [more inside]