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.
Taking control of YAML loading
A deep dive on the unintended consequence of Rails 5 replacing the superclass of ActionController::Parameters and how you can fix similar YAML loading bugs in your apps: https://dev.firmafon.dk/blog/taking-control-of-yaml-loading/
How To Change The Subject Of A Devise Email
This article describes using a custom devise controller to change the subject of your Devise emails in Rails. https://solidfoundationwebdev.com/blog/posts/how-to-change-a-devise-email-subject
Exporting data to a XLSX spreadsheet on Rails
This is a simple tutorial on how to implement a export data to a xlsx (excel) spreadsheet feature on your rails app. Read it here.
Is Phoenix deployment really that hard (compared to Rails)?
I repeatedly hear worries of (mostly Rails) web developers about migrating to Phoenix due to the completely new deployment patterns. How much does the Erlang’s great but unexplored hot code reloading complicate the deployment as we know it? Read more on Phoenix on Rails blog.
Decoding Rails Magic: How Does Calling Class Methods on Mailers Work
Have you ever wondered how it is possible that calling class methods on mailers work in Rails, even though you only define some instance methods in those classes? It seems like it’s quite common question, especially when you see the mailers in action for the first time. Apparently, there is some Ruby “magic” involved here, this article explains what happens under the hood.
Ruby Enumerable, Enumerator, Lazy and domain specific collection objects
Ruby has couple of nifty tricks up its sleeves to deal with collection objects so that they map your domain. In this article we will look on Enumerator, Lazy Enumerator and Enumerable and how to implement API collection objects in Plain Ruby so that they can be used in similar way as Rails scopes [more inside]
Rails Jailed Console
This post walks through monkey-patching the Rails console to default it into sandbox mode in production. It also adds some additional safeguards, like disabling web requests and the Sidekiq interface.
Strategies for Selective Cache Expiration
Selectively expiring cached records is essential to maintaining the health of large production caches. Do you know the right strategy for the job? http://sorentwo.com/2016/08/01/strategies-for-selective-cache-expiration.html
[Screencast] puma-dev replacement for pow and prax
Puma-dev is the emotional successor to pow. It provides a quick and easy way to manage apps in development on OS X; supporting web sockets and ssl. https://www.driftingruby.com/episodes/puma-dev-replacement-for-pow-and-prax
Say No To Bootcamp - The Mindset Reset
Take the challenge and get paid to use Ruby & Rails, even WITHOUT professional Rails experience. Let’s install a new way of thinking about your web development career today.
Introduction to dependency injection in Ruby
A short post about dependency injection and how it improves your code quality as well as how to implement it in Ruby using the dry-rb libraries: https://medium.com/@Bakku1505/introduction-to-dependency-injection-in-ruby-dc238655a278
Light Decorator Pattern
Hello Rubyists, I’ve released the stable version of Light Decorator 1.0. This is light and powerful implementation of Decorator Pattern for Rails. Also this is first gem from Light Ruby series of gems. Hope you will enjoy it!
Automatically Set User Timezone During Signup in Rails
This blog post explains how to collect a user’s timezone when they sign up on your site. http://nithinbekal.com/posts/rails-user-timezones/
A Quick n' Dirty Way to Speed Up Rails RSpec Tests
This post describes a few simple ways to speed up your RSpec test suite. Some of these are admittedly anti-patterns, but some of them are straight-forward and easy.
Awesome (Gem-Based) Jekyll Themes - A Collection of Jekyll 3.2+ Themes
Hello, Jekyll v3.2.0 is out packed full of goodies. The flagship feature is themes. Themes?! Yes. Now versioned and packed up in good old Ruby gems. The first gem-packed themes include: Minima and Garth. For more see the Awesome (Gem-Based) Jekyll Themes page. Add your theme! Cheers. PS: For more Jekyll news (and themes) follow along @statictimes
Chisel Refactoring
My takeaway from Sandi-Metz’s podcast with bikeshed at Railsconf 2016: http://borgs.cybrilla.com/tils/chisel-refactoring/
Updating my old Posts on Uploads
I’ve been blogging about upload solutions through the years, and t’s time to do the 2016 era recommendation: Cloudinary and CDNs. Rea about it here
How To Create A Dynamic Robots.txt In Rails
This article describes setting up dynamic robots.txt for your Rails app. You can use this for your staging environment or even for a multi-site app. https://solidfoundationwebdev.com/blog/posts/how-to-create-a-dynamic-robots-txt-in-rails
Introducing CacheKeyFor: cache key generator for collections
Rails 5 now provides a way of caching a collection of records, but it is still very problematic, other implementations I’ve seen are database specific. This project is an eclectic solution: https://github.com/efigence/cache_key_for
Speedy array #min and #max in ruby 2.4
#min and #max methods on Array have been optimized in Ruby 2.4 and they are a whopping 20x faster than before! http://borgs.cybrilla.com/tils/ruby-array-min-max/
Spying with RSpec
Spying is used to assert if a method has been called, this post is about how to use spies with Rspec. http://borgs.cybrilla.com/tils/spying-with-rspec/
Introducing RackToolkit: a fast server and DSL designed to test Rack apps
I’ve released the rack_toolkit gem yesterday and explain the motivation behind it in this article. It’s useful for writing fast tests (as long the application is fast to respond) that make real requests to the application through Puma. Supports automatic cookie based sessions, “virtual hosts”, proxied https simulation and many other features.
How I Tracked Down a Flaky Test
Take a look at my journey in fixing this bizarre flaky test: http://dev.paperlesspost.com/how-i-tracked-down-a-flaky-test/397
Using SSL with Passenger in development on macOS
Curious about using SSL with Passenger in development on macOS? Phusion’s got you covered: https://blog.phusion.nl/2016/07/27/using-ssl-with-passenger-in-development-on-macos/