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
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Taming Legacy Code With Characterization Tests
Developers make fun of legacy systems because we’re scared of them. We’re afraid that the tiniest change will cause the app to break in unexpected ways. We’re afraid we won’t realize it until a customer complains. One way to combat this fear is through testing. In this article, José Manuel shows us how to retrofit legacy systems with acceptance test suites so we can maintain them with less fear and more confidence. https://www.honeybadger.io/blog/ruby-legacy-characterization-test/
Rails N + 2 queries
https://dev.to/brunvez/rails-n-2-queries-4p2h A blog post about optimizing custom queries beyond simple includes
VIM and Ruby on Rails - match made in Heaven
Nowadays may be some of you are using editors like Sublime, Atom, Rubymine…etc but very few knows about the Vim. [more inside]
TestBench: a principled test framework for Ruby
TestBench is just a plain old context/specification style testing framework with significantly lighter footprint, no special run-time semantics, and requires no special runner executable other than Ruby itself. Discuss on Reddit
14 Most Asked Questions About Ruby
Check out the list of 14 most asked questions about Ruby. [more inside]
12 Most Asked Questions About Ruby on Rails
Check out the list showing the 12 most asked questions about Ruby on Rails. [more inside]
ActiveSupport's delegate as a standalone gem
delegates is the delegate :list, :of, :methods, to: :receiver API, extracted from ActiveSupport into a small, no-dependencies, no-monkeypatching Ruby gem.
Send Automated Email in Ruby on Rails with Mailgun
Learn more about how to send automated email in ruby on rails with mailgun. Mailgun is a developer tool and API for sending transactional emails. https://www.botreetechnologies.com/blog/send-automated-email-ruby-rails-mailgun
I created the same app with Rails and no Javascript
How to use Cableready with Rails [more inside]
When not to use Memoization in Ruby on Rails
Link: https://blog.joshsoftware.com/2020/06/08/when-not-to-use-memoization-in-ruby-on-rails/ [more inside]
11 Most Asked Questions About RuboCop
Check out these 11 most asked questions about RuboCop. Post Link - https://thedevpost.com/blog/11-most-asked-questions-about-rubocop/
Change Default file Path of Active Storage in Ruby on Rails 5
Active Storage makes it simple to upload and reference files in cloud services, like Amazon S3, Google Cloud Storage, or Microsoft Azure Storage. https://www.botreetechnologies.com/blog/change-default-file-path-of-active-storage-in-ruby-on-rails-5
Realtime browser updates in Rails with Cable Ready
Cable Ready is a library for triggering client side updates from the server. This is the magic behind Stimulus Reflex. It’s really simple and uses ActionCable to send over client side operations to update the UI. See how to use Cable Ready for realtime browser updates in Rails
[Screencast] Tracking Changes on Action Text
Without using any gems, we look at tracking changes within Action Text. It seems like a simple thing, but challenges arise through several layers of abstraction due to the flexibility that Action Text provides. https://www.driftingruby.com/episodes/tracking-changes-on-action-text
It's Easy to Build: Custom docs project | Part 3 - ERB templating
In this third part of the series, we’ll learn how to use ERB templating engine to insert our HTML code generated into a standard HTML file. Link to article
Ruby Refinements - A Deeper Look
I don’t think refinements get enough use and find them to be quite handy when used well. Here’s an article that explains what they are, how to use them, and why they are useful. Also, mentioned in the article, is a reference to the gem of the same name. Enjoy!
Run Rails script as an ActiveJob job
in this til noteI’ll show you how to write scripts as ActiveJob jobs instead to avoid issues with rake task timeouting out [more inside]
Timestamp management with ActiveRecord::Events
Do you like how smoothly ActiveRecord handles the created_at and updated_at fields? Now you can do the same with your custom timestamps. Check out the active_record-events gem: https://github.com/pienkowb/active_record-events
The Ruby Blend Episode 15: Rails Testing Tools and Best Practices with Jason Swett
Join Andrew Mason and Ron Cooke as they pick Jason Swett’s brain about Rails testing. This is a beginner friendly episode and goes into everything from tooling to what you should and shouldn’t test. Regardless of skill, there is something in this episode for you! Listen now!
The Progressive Rails App
Finally a tutorial, step by step, to make a Progressive Web App out of your Rails application. Fully based on Webpacker and with support for Hot Module Reload. Learn how to add a manifest.json, a service worker, write an offline page and send push notifications. [more inside]
rails_performance now works with Rails 4
https://github.com/igorkasyanchuk/rails_performance added support for Rails 4.2 (at least this is why I’ve tested). A simple alternative for NewRelic :)