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.
Creating easy, readable attributes with ActiveRecord enums
Imagine a question that can be either “pending”, “approved”, or “flagged”. Some models call for this kind of data. An attribute that can have only one of a few different values, values that rarely change. Recently, Rails took a stab at solving this with ActiveRecord enums.
Organizing JavaScript in Rails Applications with Turbolinks
I wrote a new article on Organizing JavaScript in Rails Applications with Turbolinks. Hope you enjoy!
DeepDup Gem Released
I was not able to find a plain Ruby some_deeply_nested_object.deep_dup library so I created one. GitHub link to the gem: deep_dup.
The Node.js task runner diaspora
This is the first episode of our new BazaarJS series, dedicated to exploring the world of JS, from the point of view of a Rails developer… today we’ll be talking about build tools and task runners. Gulp, Grunt, Broccoli: why so many choices, which one is better? [more inside]
Cognac Gem Released
A simple library to implement Amazon S3 upload using CORS. Browse the source code or view it on Rubygems.org
Advanced Ruby Hash Techniques
This post shows some lesser-known but super useful Hash tricks. Learn how to lazily build lookup tables, raise exceptions when hash keys aren’t present and create infinitely nested hashes. http://blog.honeybadger.io/advanced-ruby-hash-techniques/
React.js - A guide for Rails developers
Nowadays, React.js has become one of the most popular JavaScript UI libraries. This extensive tutorial plugs it into the Rails stack to build frontend-powered applications, or you might say, Rails views on steroids. https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers
Dynamic connectivity with Ruby
The dynamic connectivity problem uses a graph (a data structure) that maintains information about the relationship between its components. With this information the data structure can answer whether there is a connection between two objects or not. http://davidmles.com/blog/dynamic-connectivity-ruby/
Extending ActiveRecord association to cleanup your associations code
For some reason not many RoR developers know that they can extend ActiveRecord associations. This feature can be a great way to cleanup any relational code that is dependent on a parent resource. Here are few examples on how and when to use it: Extending ActiveRecord association to cleanup your associations code
LinkHum: humane link urlifier
LinkHum is humane, correct and customizable URL auto-linker in user-entered text. Just call LinkHum.urlify(any_text_with_urls) and there will be correct <a> tags. It tries hard to do the most reasonable thing even in complex cases.
Taskmanaging Your App, Part 1: Using Rake
Rake tasks: we all use them. But how exactly do they work? Where should you write them, and how do your tasks get interpreted? Here’s a blog post that dives down the rabbit hole of rake tasks, and how you can use them to task manage your applications!
How do I encrypt data in my database?
A beginner’s guide to keeping your data safe from those nasty bad guys: http://theartandscienceofruby.com/2015/06/29/how-do-i-encrypt-data-in-my-database/
Rebuilding Rails Model callbacks.
Where I start from scratch and (re)build the Rails Model callbacks. And some learnings along the way. http://murtuzakz.com/appreciation-rails-part-1-model-callbacks/
Rails vs. Lotus
A comparison between the two Ruby web frameworks http://teotti.com/rails-vs-lotus/
Delegating to Query Objects through ActiveRecord scopes
Query Objects are a fairly well known concept in Rails. In this post, I’m explaining how you can use a Query Object as an ActiveRecord scope.
Exploring a weighted quick find union algorithm in Ruby
In this article I explore the weighted quick find union algorithm in Ruby. This is an algorithm useful to finding out whether node A is connected to node B. Think of a maze: Is there a solution from the start to the finish? Or a network: Can computer A speak to computer B.
From Rails scaffold to React step-by-step using react-rails
I prepared a simple repository showing a process of refactoring scaffolded Rails views to React components with built-in server-side rendering. It shows how simple you can switch from static Rails views to a dynamic-ready technology.
Maktoub 0.5.0 released
Version 0.5.0 of the Maktoub gem has been released. Maktoub is a simple rails engine for sending newsletters. [more inside]
I Love Ruby update
Added section “Hash, string and frozen string, their memory foot print” , get the book here https://goo.gl/1qrMUN
Staying Productive with the Volt Component Ecosystem
Episode 6 goes over how you can save time and keep code clean by using Volt components in your applications.
Be aware about the out-of-memory killer
One of the most important things for applications is stability. There are various hosting platforms that give you virtual servers, where you can run multiple services. There is no limit to the number of processes so it is up to you how much of their resources will be used. However, exceeding all available RAM memory can result in poor stability or even a server crash. This article gives you some basic knowledge about the out-of-memory system state. [more inside]
Fluxbox Apps Menu
If you are a Fluxbox user you can build your apps menu through this gem: https://rubygems.org/gems/fluxbox_apps_menu Just some day ago i released the new 1.2.0 version.