If you just started to learn a programming language and web framework, here is my suggestion about what to work on: What project to work on Choose a successful SaaS product tha...
If you just started to learn a programming language and web framework, here is my suggestion about what to work on: What project to work on Choose a successful SaaS product tha...
How do these things work? Have you ever wondered how the following code works? Specifically, how come the key will have another value than true or false. key = loaded_key || Ke...
Context You want to update the same column for multiple records in one query and set different values for each record. Example: class Car < ActiveRecord::Base # has attributes: ...
I was inspired to write this article by a question asked by Adrian Marin in the Twitter Ruby on Rails community and the responses I read there. https://twitter.com/adrianthedev/...
Context Let's say that you have two array of hashes: a = [ { initial: "a", email: "a@example.com" }, { email: "b@example.com", initial: "b" }, { ...
Context You need to design some routes with the following properties: you need to do some computation in the backend they are idempotent: every time you call the route with the...
Context You have a column in your table that is used as an array , like this: t.string 'ids', array: true And you want to select all records that have more than N elements i...
This is more like general advice, but when possible minimize dependencies. I will write the following examples with Ruby gems in mind but could be used in any other programming...
Context You have an array of hashes and want to check if all elements are satisfying a condition. TIL You might want to do this in Ruby: objects.all? { _1[:amount] > 10 } In th...
Quick tip about how to create a new rails project with a pre-release version of rails
You can also subscribe with RSS!