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.
Not-so-private constants in Ruby
Sometimes intuition cheats us. That was a case for me with defining private constants in Ruby. Putting them within private block is not enough to achieve the desired effect.
Playing with Ruby object model: prototypal inheritance
The article shows how to implement something resembling prototypal inheritance. While the end result shouldn’t be used in production, I think it’s an excellent opportunity to learn or systematize certain concepts of the Ruby object model. Read more
Programming Crypto Blockchain Contracts (in Ruby) Step-by-Step Guide / Book
Hello, I’ve started a new (free online) step-by-step guide / booklet titled “Programming Crypto Blockchain Contracts (with Ruby) Step-by-Step Book / Guide Let’s Start with P@nzi & Pyr@mid Schemes. Run Your Own Lotteries, G@mbling C@sinos and more on the Blockchain World Computer…”. The first chapter is online with ready-to-run contract scripts in ruby. Don’t Miss the Investment of a Lifetime! May the Brave be Rewared with Riches! Cheers. Prost.
Managing ActionCable Easily
Stimulus.js can be used to setup and tear down connection very easily, just by using the controller’s life cycle and changes to the page.
42 performance tips for Ruby on Rails
I listed 42 of my favorite performance tips for Ruby on Rails. Read more
How ActionCable broke Puma
A short, slightly technical, review of why ActionCable and Puma conflict and why AnyCable or iodine should be used:
Eileen Uchitelle on Getting into Programming, Joining the Rails Core Team, and more
In this episode, Eileen Uchitelle joins Chris Oliver and Jason Charnes to share her journey into programming, how she began contributing to Rails (and subsequently joining the Rails Core Team), and other fun facts/stories around software development. Read more
How to Protect Individual Resources with Passwords
Hello! I’d like to share a simple technique for password-protecting individual resources in Rails apps:
Data Structures From Scratch (ebook)
A brisk introduction to essential, advanced, and persistent data structures using the Ruby programming language. Read more
Ruby's p vs puts Method
The puts method in ruby is very popular all over the internet it’s generally used by ruby programmers for debugging purposes and to output the value of certain variables so we can see what’s goin on in our system. However puts can sometimes lead you astray because of how it converts everything into a string. See how p is different from puts
Enumerate through paginated REST API resources
When working with a JSON API that exposes a list of resources we typically are in presence of paginated results. Today we enable a client library to efficiently enumerate through resources while hiding the complexity of pagination
Chain of responsibility pattern in Ruby on Rails
While we were working on a project we stumbled upon some legacy code that consists of huge ‘if else’ statements. In this post we’ll show you how we refactored it using the Chain of responsibility pattern. Chain of responsibility pattern in Ruby on Rails
Who takes out your trash?
Rain Leander, Technical Program Manager for OpenStack at Red Hat, and Sanne Kalkman, software engineer, on Red Hat Linux and Ruby, and garbage collection respectively:
How to increase app performance by 5-20% (by optimizing rendering time)
crazy idea how to improve performance in your Rails application (if you using ERB, but maybe similar could be implemented for slim/haml/etc). Read more
ActiveStorage variants are persisting original image EXIF metadata
Imagine you are using Rails 5.2 ActiveStorage. Now you upload an image, render it with app.url_for my_model.image.variant(resize: '400x300') and discover that it’s rotated 90 deg to you would normally expect. You copy paste the link to the image to the browser and discover the image is rotated correctly. How is that possible? Read more
Backport support for embedded ERB in Slim views
for developers who are using Slim templates with embedded ERB. Read more
First explorations of GitHub's Actions
With the help of a friendly Hubber we set out to automate the workflow of releasing a Ruby gem, based off of the GitHub Action for npm:
Popularizing your Ruby gem
Once you’ve published your own ruby gem, learn what to do next to get the most out of it. Promote your ruby gem and engage with the developers in the Ruby community Read more
How to neatly organise assets in a Rails app
Rails comes packed with a lot of useful conventions. However, it doesn’t say much about how we should organise our front end assets. Here is a way in which we can leverage the same conventions we use to organise our controllers and views to have a neatly organised assets directory. Read more
Here to stay - Analyzing RubyGems stats for 2018
What’s up with Ruby? With all the ups and downs in 2018, is it dead or alive? Here at Infinum, we’ve done our research and compiled some stats so check it out. You’re welcome.
Time Zones From A Developer's Perspective
Have you ever wondered how timezones (correctly) works on Ruby on Rails, React and PostgresSQL? Do you wanna know some best practices about it? Read more
Features in Ruby I Miss While Working in Python
For a long time, I worked primarily on the Ruby on Rails stack. Recently, I moved back over to Python and Django. Both Ruby and Python are a joy for programming! They’re easy to learn and enable software developers to be productive very quickly. However, there are some features of Ruby I miss while working in Python. Read more