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.
[Screencast] Testing with RSpec
Using RSpec, learn how to create tests for your application and view your coverage. https://www.driftingruby.com/episodes/testing-with-rspec
Two ways for testing eager-loading of ActiveRecord associations in Rails
There are 2 ways (the easy one and the unusual) to test whether your eager-loading is actually of associations is actually working .
OOP and Rails System Tests
In this post we will take a look at a way to improve sample Rails 5.1.3 System Test using POROs, collaborators, delegation and modules. https://bpohoriletz.github.io/2017/10/16/oop-and-rails-system-tests.html
Hanami v1.1.0.rc1
Association aliases, entities as types in custom schema, --relation option for model generator, RSpec metadata, bug fixes, feature freeze. http://hanamirb.org/blog/2017/10/16/announcing-hanami-110-rc1.html
Unsafe Object Deserialization Vulnerability in RubyGems
Read this for the full explanation of the problem and the very speedy fix. http://blog.rubygems.org/2017/10/09/unsafe-object-deserialization-vulnerability.html
Organizing My First Conference: Southeast Ruby
Organizing a conference is a mix of joy, sweat, and fear. Here is an in-depth look at what it took for Southeast Ruby. [more inside]
Custom Rails error pages
I’ve written an article on how to customise the error pages that ship with Rails, this includes some templates to help you get started. https://pooreffort.com/blog/custom-rails-error-pages/
Explicit Params Binding in Ruby Web Apps (why convenience is sometimes inconvenient)
I express my concerns with Rack’s behavior of automatically converting params to arrays or hashes depending on how the params are formatted in my lattest article Explicit Params Binding in Ruby Web Apps. It also expands on how convenience can sometimes be inconvenient.
Sending JSON API like 401 Unauthorized error with Devise
I put a short HOWTO on bending Devise error messages to adhere to JSON API spec.
No More Best Practices
This article is my thought about so called “Best Practice” in programming language. Looking for discussions about this topic :-)
Ruby 2.5 New Stack Trace
I put together a video of the new stack trace format so you can see it in action :) https://www.youtube.com/watch?v=rgPA3kzqiyA
Why Ruby app servers break on macOS High Sierra and what can be done about it
Upgrading to High Sierra or planning to? This is what you should know.
CSRF protection on single page app API
Single Page application is awesome paradigm but because they communicate with APIs there is lot of confusion around what security measures are needed and what are unnecessary. In this article I’ll try to explain when is CSRF protection needed. [more inside]
Which JSON Serializer To Use For A New Rails API?
Have you ever wondered if there were benefits to using Jbuilder vs. Active Model Serializers? Has AMS been replaced by JSONAPI::Resources? There are a lot of JSON serializers to choose from for a Rails API, so which one is best? I think it all comes down to your project’s needs and your coding style. Use this review of the most popular options to make sure you’re using the right one for you.
Overhauling the PorkCast database in Rails
Millions of rows of data needed a makeover. Here’s how I did it. https://schwad.github.io/ruby/rails/database/2017/10/13/overhauling-the-porkcast-database-in-rails.html
Testing Jekyll Websites with HTMLProofer
How to deal with link rot on your Jekyll blog or website using the HTMLProofer gem. [more inside]
Scraping websites with Ruby & Headless Firefox
Learn how to scrape websites with Headless Firefox and Selenium WebDriver: https://readysteadycode.com/howto-scrape-websites-with-ruby-and-headless-firefox
Receiving and Parsing Email in Rails 5(With Griddler and Mailgun)
Another aspect of email within a SaaS application is receiving email. While this is far less normal or used in comparison to sending, it can be a great way to make end user’s responses to email or action items quicker. https://hackernoon.com/receiving-and-parsing-email-in-rails-5-c975c2766364
Colorls = ls + color + icons
Colorls is a Ruby CLI gem, which tries re-creating support for ls, and much more such as –git-status and –tree flags. https://github.com/athityakumar/colorls
Reusable UI components in Rails
Have you ever worked in a web application with many custom user interface (UI) components? How were they structured? This article shares some tips and tricks on how to organize them in a Ruby on Rails application. [more inside]
7 Little-Known Ruby Methods To Help You Write Better Code
Expanding your mental toolbox of Ruby methods will help you write better Ruby code! http://www.rubyguides.com/2017/10/7-powerful-ruby-methods/