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.
Separation in a Rails monolith: layouts, assets, and controllers
Consider introducing separation in your Ruby on Rails monolith with some simple techniques.
An Introduction to Crystal: Fast as C, Slick as Ruby
Ruby is awesome, but it is not necessarily known for its speed. Sometimes it is not the right tool for demanding applications. Learn about Crystal here.
The Pros and Cons of Ruby Refinements
The purpose of Ruby refinements is to scope changed behavior to a very specific area of code. Here is how to use them, as well as pitfalls to avoid.
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:
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.
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.
RSpec::Core Cheat Sheet
Short code examples for the features in RSpec::Core.
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?
[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:
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.
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!
Spying with RSpec
Spying is used to assert if a method has been called, this post is about how to use spies with Rspec.