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.
When abstraction is a mistake: ActionController::TestCase
On example of ActionController::TestCase, I’ll show why hiding things into an abstraction is sometimes not the best thing Rails can do. Read more
Build a Fantasy Football News Hotline with Ruby and Twilio Voice
From 1972 until the mid-90s, a business called Sports Phone was about the only way for fans to get up-to-the-minute scores and news. We thought it’d be fun to recreate Sports Phone using an RSS feed, Twilio Voice, and 30 lines of Ruby. Read more.
Better ActionMailer testing with ActionMailerMatchers
ActionMailerMatchers provides you with RSpec one-liners that help you to test sending emails in your Rails application. [more inside]
Rails lets us focus on the hard stuff
Staying focused on business needs, and letting Rails handle the rest, was the only way to ship. This is a defense of the full-stack framework. Read more
Making a JS plug-in: a Full-Stack approach
We will introduce a way to create a client side JavaScript plug-in that can be easily integrated in any third party websites. This plug-in will allow us to execute custom actions such as filling a registration form or maybe displaying information related with your website.
Slide Show (S9) Update - Write Your Talks w / Markdown (kramdown) n Jekyll Themes
Hello, I’ve updated the Slide Show (S9) machinery. All slide show templates / theme packs are now just Jekyll themes (using Liquid) and thanks to the latest GitHub update back on the master branch (e.g. no more gh-pages needed). The latest theme packs include Reveal.js and Shower. For some example see: Reveal.js templates and the live demo • Shower templates and the live demo. ++ Any favorite slide show/presentation package? Questions? Comments? Welcome. Cheers.
[Screencast] Authentication Crash Course with Devise
Devise is a flexible authentication solution for Rails based on Warden. Learn how to add a stable authentication solution like Devise to your application. https://www.driftingruby.com/episodes/authentication-crash-course-with-devise
Express vs Rails: Framework Comparison using a Simple Game API
A side-by-side comparison of these two frameworks (and languages) would be excellent. To make the comparison fun, it is ported in a simple web-based game. Full findings here
Don’t be liberal when being aggressive. A short story on ruby hash’s fetch with defau
A short example of how dangerous (potentially) can be using hash’s fetch method with default values. READ
Replacing controller specs in Rails apps, part 2: Features
Part two of my series on replacing RSpec controller tests is now up at Everyday Rails. This time I switch out some complicated controller specs for an easy-to-read feature example, removing dependencies on deprecated helpers like assigns and assert_template.
Rails 5 adds ability to create module and class level variables on per thread basis
In Rails 5, we can create specific class and module variables that live for the lifetime of a thread. [more inside]
What are real-world examples of good Ruby code for beginner side projects?
I am looking for input on real-world projects that demonstrate good Ruby style and coding practices. It can be libraries, apps, plugins, etc, whatever you think shows a very high quality of coding? I am looking to incorporate it into small Rails side projects to help me level up. Peter Cooper asked a similar question in 2009
Tricks with RSpec components outside RSpec
RSpec provides many useful idioms (like argument matchers and method stubs) you can use outside any testing framework just for your everyday scripting. Here is how (and a bit of why).
Resumable File Uploads in Ruby
Uploading large files is something that can be a challenge to achieve reliably, especially over mobile networks. Tus is an open protocol for resumable file uploads over HTTP. I recently released tus-ruby-server, the Ruby server implementation of tus, and wrote about adding resumable uploads to your Ruby applications.
Highspeed SPA Architecture with Oxymoron gem. Amazing results and fast development
9 months ago, I began to explore the interaction of Rails and AngularJS. All my ideas I have laid in Oxymoron gem. This gem contains the Angular resources and UI-routes which are automatically generated from the Rails routes (from routes.rb). Gem includes many useful directives and services. Also it includes all the necessary configs. It really saves us up to 80% of the time. Me and my team have been written more than 15 commerz Rails apps this year based on Oxymoron. Applications are very fast and have beautiful architecture. [more inside]
Easily output tabular data in HTML, CSV or XLSX
My new gem dining-table allows you to easily create HTML tables based on clean table classes instead of messy views. The same table classes can be used to export the data to csv and xlsx. Check it out if your app needs to handle or export tabular data.
Keep it simple, stupid
We both know that KISS principle along with the time we’re working. Recent months, I have more in-depth recognition about it. I would like to show a few examples to elaborate more from different aspects.
Gem upgrade load path adventures
A short writeup on working through a load path issue when upgrading a gem.
Named Regular Expression Captures in Ruby
This is a short article outlining how to use named captures when you are using the match method… allowing you to assign a name to what you are extracting.
New Beta of "Take My Money" available
Beta 2 of Take My Money: Accepting Payments on the Web by Noel Rappin is now out. [more inside]
Zip S3 in ruby, streaming VS download
We’ve recently had to generate zips in Ruby from files present on S3. Since various documentation sources were out of date, we’ve written a HOW TO, including the 2 example of download files and zip + zip streaming.
How To Conditionally Send Emails With Rails ActionMailer
Ever want to disable only the sending of emails for a particular length of time, different environments, or for any other reason? This article describes conditionally sending your emails using a simple before_action in Rails.
The contents of my ~/.railsrc and why
The ~/.railsrc - a file that stores your default preferences for rails new - must have passed me by on its arrival years ago with Rails 3.2 and from what I can gather it’s also underutilised by other experienced Rails devs. It’s time to evangelise, here’s the contents of my ~/.railsrc and why.
Managing Private Dependencies with Bundler
Bundler, a great resource for managing dependencies in your Ruby projects, helps verify compatible versions of your gem dependencies. Read more here.
Efficiently and Conveniently Building Ruby and Node.js Application Docker Containers
In this Phusion article we show how we build Docker application containers in two steps and explain why that is a useful thing to do. We then walk you through writing a build script that not only builds an application container but also runs its unit tests, checks with the source repository for conflicts or unchecked changes and tags and pushes the final image to the container repository. [more inside]