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.
JavaScript Debugging for Rubyists
Brief translation guide to help Rubyists discover the JavaScript equivalents of common Ruby debugging techniques https://eliotsykes.com/debug-js
Building Minimal Docker Image for Rails App
How to build minimalistic Docker image for Rails application: http://blog.kontena.io/building-minimal-docker-image-for-rails/
Rails Interactor Pattern - Part 2
This time I’m adding some helper methods to our interactor, which will make handling failure cases easier and more obvious. Here’s the link to part 2 or first catch up with part 1.
Sequel vs Active Record ORM Benchmark on PostgreSQL
In my machine Sequel has better performance than Active Record - http://www.railsmine.net/2015/09/sequel-vs-active-record-orm-benchmark-postgresql.html
XML or JSON API?
In lesson #4 of the Build Less, But Better Software email course, we looked at 5 ways APIs help businesses increase revenue. In lesson #5, we’ll look at technologies that go into delivering API, XML and JSON
Ruby 2.2.2 Array Basics : Part 8
Ruby 2.2.2 Array methods such as frozen?, freeze, hash, include?, index, replace, insert, join, keep_if, last, collect, map and map with_index. Watch it here here
Inch reaches 0.7.0
Inch, a gem to measure inline documentation coverage, has reached v0.7.0. Inch CI is already running it!
Image Processing in Rails using AWS Lambda
A common problem with image processing Rails apps has been the excessive memory consumption within the worker processes. When images are large enough, our worker will consume a big portion of our memory and will take forever to finish. If you are deploying on Heroku, you will probably be paying for the cheapest worker and the R14 notification emails will be flooding your inbox. Learn the solution here
CrashBreak: A new approach for dealing with production exceptions and bugs in Ruby
Hello! Some time ago I was working on an application that had many bugs and reproducing each one was time consuming. I thought about making this process faster and more user-friendly. Recreating bugs manually in the browser by typing data and setting all connected modules in the same way like when the exception occurred can be annoying. Also, there is no certainty that the bug is reproduced in the same way it occurred. The other problem is that many of the bugs are hard to reproduce and connected to different layers of the system. The idea of CrashBreak is to reproduce the exception from the staging server on the programmer’s computer by running a request test. In order to do this the library needs to dump your system piece by piece. Currently we have 3 dumpers: for database, all request data (headers, url, body) and user session. We tried to create the whole system in an adaptive way. It means that you can write your own extensions to adapt the library to your needs. The beta of the service is ready and available at http://crashbreak.com Please give it a try and send me your feedback so I can make CrashBreak even better. Thank you kind strangers! Michał Janeczek
How to turn they’re back into they’re
There’s an encoding problem that’s especially tricky to solve – when a curly quote turns into ’, or an em-dash turns into —. Learn why it happens, and see a code snippet that reliably fixes it.
How to Serialize an Array of Objects.
Hello everyone! I have been facing a problem. I have an object (class) named Note, and I have a global variable array of these objects named notebook. What I intend to do, is to make the notebook persist between sessions. I’ve tried Marshal but maybe it was all wrong. Please help. Here’s the link to the source.
SEO for Rails
Some search engine optimization advices for a Rails app. Along with available tools in ruby : http://vdaubry.github.io/2015/02/23/SEO-for-rails/
Create Ruby Gem by Example
Learn how to build a Ruby gem by creating one http://www.victorareba.com/tutorials/create-ruby-gem-by-example
Ruby 2.2.2 Array Basics : Part 7
Ruby 2.2.2 Array methods such as drop_while, each_index, empty?, fetch, fill, index, first and flatten is covered. Watch it here here
How I spent two weeks hunting a memory leak in Ruby
This is a story about hunting a memory leak. A long story, because I go into much detail. http://www.be9.io/2015/09/21/memory-leak/
What's new in Rails 5?
Rails 5 is a new major version of Ruby On Rails, this implicates that the Rails API and requirements can change to deprecate, add new, and/or improve existing APIs, but also to take advantage of important changes in the Ruby language as well. [more inside]
Engines Before Microservices
An opinionated post on starting with engines when breaking apart a monolithic Rails application. http://www.markphelps.me/2015/09/20/engines_before_services.html
Thou Shalt Not Complicate, Pt.1: Three Kinds of Programmers
A strong rant on what kinds of good programmers exists, and which of them Ruby suits best.
Ruby Tip - Capitalize Only First Letter Of Each Word in String & Leave The Rest Alone
How to do better string titleization in Ruby. http://solidfoundationwebdev.com/posts/asd
Rails Tip - Uninitialized Constant Model When Plural Is The Same As Singular
Dealing with model names that are the same in singular and plural ex. equipment http://solidfoundationwebdev.com/posts/uninitialized-constant-model-when-plural-is-the-same-as-singular
Continuous Integration for Ruby Security
Introducing continuous integration on Hakiri. You can now automatically scan GitHub pull requests for security vulnerabilities. It’s completely free for open source projects.
Working Hard or Hardly Working, Part 2: Custom Jobs
With the advent of ActiveJob in Rails 4.2, writing custom jobs has never been easier. This blog post unpacks job generating, writing, and execution, and also highlights some tips and tricks like using the touch method!
Ruby 2.2.2 Array Basics : Part 6
Ruby 2.2.2 Ruby methods such as collect, map with index, map, combination, compact, concat, delete_at and delete_if. Watch the video here.