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.
From Action Cable to AnyCable
The article explains the differences between Action Cable and AnyCable along with some useful migration tricks. [more inside]
Build advanced and bulletproof applications with Rails - learn about transactions
The transaction is a set of smaller actions such as database records creation, very often combined with an external API call. Learn how to use transactions READ MORE
fizzbuzzer gem - 1, 2, Fizz, 4, Buzz, Fizz,... - a collection of fizz buzz algorithms
Hello, I’ve put together a new fizzbuzzer command line tool and library (gem). 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, … - The fizzbuzzer library includes a collection of algorithms for playing the word game for children that teaches division (one of the four basic arithmetic operations in mathematics) or helps you find the world’s best coders in programming job interviews. Are you (re)using the fizzbuzzer library? ;-) Don’t reinvent the wheel or the feedbuzzer! Cheers.
Rails 5 attributes API, value objects and JSONB
A guide on how to use value objects in your Ruby on Rails applications with PostgreSQL JSONB. [more inside]
Refactor your Rails conditions like the best ones do: null object refactoring pattern
Looking for an excellent replacement for if conditions where you check if an object and its attribute are present? Meet null object and give it a try - READ MORE
Classics - 10 One Liners to Impress Your Friends - Ruby • Perl • Python • PHP ...
Hello, for a new Yuki & Moto Press book titled “Ruby Compared with Other Languages” I’m reformatting/republishing the evergreen classic titled “10 One Liners to Impress Your Friends” orginally posted in 2011 to show off Scala to pre Java v7 devs - now in the updated version incl. Ruby • Perl • Python • PHP • Erlang • Java • JavaScript. Show off Ruby to your friends :-). Cheers.
Generative Art in Ruby
I’ve just released a new version of my math_tool gem (only requires jruby) that should convince you generative art is possible with ruby. https://github.com/ruby-processing/math_demo
Classic - 10 Things Every Java Programmer Should Know About Ruby by Jim Weirich
Hello, for a new Yuki & Moto Press book I’m reformatting/republishing the evergreen classic presentation by Jim Weirich titled “10 Things Every Java Programmer Should Know About Ruby”. The items read: #10 Learn Ruby Conventions ++ #9 Everything is an Object ++
#8 (Almost) Everything is a Message ++ #7 Ruby is Way More Dynamic Than You Expect ++ #6 Objects are Strongly Typed, Not Statically Typed ++ #5 Don’t Worry About Interfaces ++ #4 Mix it up with Mix-ins ++ #3 Embrace Closures +++ #2 ri is Your Friend, irb is Your Other Friend ++ #1 Write Less Code ++ #0 Ruby Makes Programming Fun Again. Cheers.
Mapbox for Rails
mapbox-gl-rails is a set of Mapbox GL javascripts and stylesheets for Ruby on Rails asset pipeline. Just add it to your Gemfile in order to add interactive maps to your application.
Ruby on Rails and ActiveRecord self-join - tables naming explained
Usually, you don’t think about tables naming because it’s obvious. However, there is a case when you might stop for a second. I’m talking about a self-join instruction READ MORE
A Day in the Life of an Agency Rails Developer
What does a typical day look like for a Rails developer? Here’s a time breakdown of what it really looks like. https://blog.planetargon.com/entries/a-day-in-the-life-of-an-agency-rails-developer
Paris.rb conf 2018
Come to have fun with us on June https://medium.com/paris-rb/paris-rb-conf-2018-2fcedcf1384f
Sinator version 3
I’ve just released Sinator version 3.0.0. Sinator is a Sinatra based web application generator.
SimpleResourceController - a lightweight alternative for inherited_resources
simple_resource_controller is a simple and powerful tool for writing CRUD controllers.
Net::HTTP by Example / Net::HTTP Cheat Sheet @ Yuki & Moto Press Bookshelf
Hello, I’ve added the Net::HTTP by Example / Net::HTTP Cheat Sheet by August Lilleaas et al to the Yuki & Moto Press Bookshelf. Free Online Books (and Booklets) about Ruby ‘n’ Friends in the Manuscripts format and built with Jekyll and Octobook themes. Happy reading. Cheers.
Translate every Rails query in a SQL code - for learning and debugging
Rails to_sql method is a well known method for Ruby programmers but mostly junior developers may not be familiarized with it yet. It’s super helpful so it’s worth to mention it once again READ MORE
Do not run Rails with pending migrations
Learn how to ensure that Rails processes won’t boot up and make a mess without being up to date with database changes.
Tutorial: Distributed Tracing in Ruby with OpenTracing
Tracking a transaction across several microservices is hard. However, thanks to OpenTracing, a vender-neutral tracing API, this is getting easier. I show how to add distributed tracing to a pair of Sinatra apps and view those traces in Jaeger, an opensource distributed tracing system.
Frontend Fun with Rails 5.1 and Webpacker
Using the Webpacker gem with Rails 5.1 to easily and quickly get started with frontend frameworks, specifically Vue.js and React.
Routing form objects with Rails
A look at to_model and how to use it with form objects in Rails: https://christoph.luppri.ch/articles/rails/routing-form-objects-with-rails/
Dear Ruby (1): What about Arguments when Inheriting?
An idea that allows passing arguments when inheriting, making it easier to implement clean DSLs.
Order unique results in Ruby on Rails in an easy way
If you ever tried ordering unique results you probably know that it’s not possible to make this in a simple query because ActiveRecord requires to explicitly select each column you want to operate on. I want to know how to do this