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.
Invalid Object Is An Anti-Pattern
Here’s some food for thought where I present the idea of objects validating themselves as an anti-pattern and provide a short introduction to dry-data and type-safety in Ruby.
Disqus on Rails - How to implement and why?
Did you ever wonder how to implement disqus on your rails blog? It’s easy, but the real question is: why it’s better than standard comments?
Refactoring in Ruby: TDD your way through Extract Class
In this post, I cover an example of refactoring Ruby code with the Extract Class pattern by using Test-Driven Development. Check it out here.
New features in Ruby Raven
Released a new version of Ruby Raven. For more info read the blog
Wye Tech News #4
A new issue of our weekly compilation of interesting news and articles about Ruby, Rails, JavaScript and web development related stuff that we found during the week.
Terminal input with tty-prompt
I’m happy to introduce tty-prompt for gathering user input in terminal. You can ask user for a masked input, keypress, multiline text or to select a single or multiple options from a list. The library sports a robust validation mechanism that provides dynamic error messages. Finally, tty-prompt comes with many conversion methods for converting input to desired type. Give it a try and let me know what you think!
How HTTP headers get passed from nginx to your Ruby app
Whether you use rails, Sinatra, or Lotus, you don’t really have to think about how cookies and other headers pass from nginx or apache, to the application server and into your app. We’re going to examine this journey in a little more depth. Because it turns out that the story of headers contains a lot of interesting information about the history of the web. http://blog.honeybadger.io/how-cookies-and-other-http-headers-get-passed-from-nginx-to-rack-and-into-rails/
One more Enums implementation in Ruby. What for?
Check out my recent post about one ore Enums implementation in Ruby. Why did we released it and what for? All the answers are there. Your questions, notes, criticism, pull requests and issues are welcome!
Delayed Job Gem for CSV
Delayed Job Gem is a ruby gem which can be applied to execute certain tasks in background process in the Rails environment. Read full article at RailsCarma Blog.
Third way to use block argument
Recently I found a relatively rare used way to use block argument in a method, and I wrote a post to introduce it.
Stream Comments with Rails 5 and ActionCable
A basic implementation after staring at DHH’s examples for a few hours - When Code Explodes!
Fastgem -Terminal client for search ruby gem
Fastgem is a terminal client for search ruby gem. Only supports Ruby 1.9 and later. [more inside]
Shrine 1.1.0 released
Few months ago I released Shrine, a new solution for file uploads. The new version brings 7 new plugins, 6 new storages (Cloudinary, Flickr, Fog, GridFS, Imgix, SQL), lots of tiny new features and performance improvements.
Don't use Dvorak to improve productivity
Why vim users should stay with uncomfortable QWERTY layout There is common opinion that switching to Dvorak is amazing if you want to improve productivity. I checked this out and yeah, it is amazing, but not for everyone.
ActiveSupport's with_options helps you stay DRY
Nice feature with one unclear behaviour http://undefined-reference.org/2015/12/26/drying_your_classes_with_options.html
Upgrading Server Ruby to 2.3.0 on VPS using Moonshine
Step by step instructions on how to upgrade Ruby to 2.3 on your VPS
Upgrading to Ruby on Rails 5.0 from Rails 4.2 – application use case
Ruby on Rails 5.0 is just around the corner. Here’s a quite extensive tutorial based on one of my applications on how to migrate from Ruby on Rails 4.2 to Ruby on Rails 5.0. Upgrading to Ruby on Rails 5.0 from Rails 4.2 – application use case
How Ruby 2.2 can cause an out-of-memory server crash
Bad news—Ruby (MRI) can cause an out-of-memory server crash. The issue first appeared with version 2.2.0-preview and has remained ever since. [more inside]
A Holiday Thanks To Rails
In 2014, when I wrote my first Rails application, it was an awakening for me. Rails became a gateway into understanding not just web applications but software architecture in general. Before that, I wrote hermit scripts that died alone in shells and verbose yet static HTML and Javascript unaware of where it lived. Then, one command changed the game for me — [more inside]
Build MiniTest From Scratch to Learn Ruby Metaprogramming
One of the best ways to learn something is try to build it yourself, and compare it with how other programmers have done it. We went through this process to Build MiniTest From Scratch to Learn Metaprogramming
Reform 2.1 With Dry-Validation and Grouping
Reform 2.1 brings dry-validation support, validation grouping and chaining, and some cool API extensions for populators. Read the release blog post here.
Simple encryption of ActiveRecord fields
With OpenSSL::Cipher
and ActiveRecord support for column serialization, it’s quite easy to encrypt model fields on the database layer
ActionCable Devise Authentication
Tutorial to make ActionCable and Devise together: ActionCable Devise Authentication
Finding bugs with HTTP verb and response code mismatches
Recently I found that an odd combination of HTTP verb and response codes helped track down a bug. Have you run into any more combinations like this?