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.
Grub - Add comments to your Gemfile with each dependency's description
Check out this simple tool to clarify your Gemfile contents by adding a comment for each gem that describes what it does. Try it out live at https://grub-gemfile.herokuapp.com/ or install the tool yourself https://github.com/ivantsepp/grub . Let me know what you think and file any issues/ideas you have at GitHub
Rails plugin to send Newsletters via Amazon SES
I just published a Rails plugin that allows you to easily build and send Newsletters via Amazon SES (which is very affordable). The name of the gem is aws_ses_newsletters. It uses Sidekiq (because you will usually run the process asynchronously) and Premailer to inline the css. You can find the code here: https://github.com/10Pines/aws_ses_newsletters The readme has detailed instructions to install it and use it. There is also a demo project at: https://github.com/10Pines/aws_ses_newsletters_demo Any feedback will be appreciated!
How to Diagnose Ruby on Rails N + 1 Query Problems
Diagnosing performance problems in a production Ruby on Rails application can be deceptively complex. Development environments that are not subject to typical production web traffic may not make performance issues evident. In those instances, the use of some simple (and mostly free) tools can help diagnose performance issues in production.
Changes to test controllers in Rails 5
In Rails 5, controller tests have undergone some major changes. [more inside]
How to Reply to an SMS with Rails and Twilio
Video tutorial and quick blog post on how to reply to text messages with Twilio and Rails.
When to avoid the DRY principle
The DRY principle is great, and often leads to a higher quality of code but, as Luke Morton explains using RSpec examples, it’s possible to take it too far. https://www.madetech.com/blog/when-to-avoid-the-dry-principle
dokku VM setup with hints on how to use Rails on top
I described a workflow to use dokku in Ubuntu VMs and some basic hints on how to host a Rails app on top of this. The app can make full use of postgres, persistent storage (e.g. for file uploads) and two-and-a-half-lines-of-code SSL support (letsencrypt). I find the little tools around that setup real fun to work with. Find the article at http://fwolfst.github.io/docker/dokku/dokku-alt/virtualization/2016/04/18/dokku-on-ubuntu-vm-complete-rails.html . It might still be rough at the edges, feedback more than welcome!
Decoding Ruby on Rails (3+) signed session cookies
A quick article on how to decode the signed session cookies that are used by default in Ruby on Rails 3 (and up). Read more here: http://www.markcampbell.me/2016/04/18/decoding-the-ruby-on-rails-signed-session-cookie.html
Use Ruby’s Refinements Anywhere With An Anonymous Class
After lots of experimentation and searching over a few years I’ve finally found a way to use Ruby’s refinements conveniently and anywhere. You don’t need to define a class method to use the refinement or instantiate an instance of a class that has the using syntax in it. You may use using in an anonymous class if it is opened with the shovel operator « . Read more here: Use Ruby’s Refinements Anywhere With An Anonymous Class
Spina CMS - Update 0.9.0
The nicest Ruby on Rails CMS is getting more and more users and contributors. Thanks you guys! [more inside]
Improving Rails application documentation
Reading and writing more Python and Elixir has me thinking about how to improve the quality of Rails code bases, through better documentation practices. Here are some steps I’m taking to improve my Rails projects’ docs.
Using PaintCode with RubyMotion
Here’s a quick overview of using PaintCode and translating the exported code over to Ruby for your RubyMotion project. => https://youtu.be/Nat4umZDMHA [more inside]
Using Webpack with Middleman
I use the Ruby static web framework, Middleman, to build my site, https://rossta.net. Middleman dropped support for Sprockets in its latest major release so when I went to upgrade recently, I needed to replace my asset pipeline with something else that turned out to be Webpack. I’ll describe the new external_pipeline feature in Middleman and how I got it to work with Webpack. https://rossta.net/blog/using-webpack-with-middleman.html
New Reality Release
Today we are announcing new release of Reality–comprehensive data proxy to real world. In the release: new shiny documentation, new reality console command and many other goodies.
Rails 5 has added accessed_fields to find the fields that are used in application
Rails 5 introduces accessed_fields method to determine all the fields that were accessed on a model while performing some operation. [more inside]
Short tutorial for deploying Roda app with Capistrano
Writeup of steps i needed to deploy my Roda app into whole new AWS EC2 instance with Capistrano: http://masa331.github.io/2016/04/15/deploying-roda-app.html
Try kramdown Online Editor & HTTP JSON API Service - Convert Markdown to HTML & LaTeX
Hello, I’ve put together a simple online editor that lets you try the kramdown library converting markdown to HTML or LaTeX. The online app also includes a HTTP JSON API service (e.g. /markdown) for conversion. All is packed up in the kramdown-service gem for easy (re)use and as an extra bonus includes a binary, that is, kramup, that starts up the online editor and service on your local machine (e.g. use $ kramup). Supported conversion options/modes include: [more inside]
Allowing Nginx to use a Puma/Unicorn UNIX socket with SELinux
If you are deploying Ruby applications to Fedora/CentOS/RHEL you might find handy to know how to allow Nginx to talk to Puma server.
paperclip_utils Gem Released
Check out the new gem I made called paperclip_utils. I originally built it to make thumbnails only for file types that can be made into an image. It is now a collection of custom paperclip processors and a helper class to work with dynamic processors and styles. I would like to encourage anyone to add any useful paperclip processors they have or know of. https://github.com/westonganger/paperclip_utils
Docker: Tools and Workflow Overview
In this video we go over the different tools that are involved in setting up an automated deployment system. We also show you the workflow that you will be working with on a daily basis with this setup. [more inside]
Rodauth: Authentication and Account Management Framework for Rack Applications
Rodauth 1.0.0 was released today, adding support for 2FA via TOTP/SMS/recovery codes, multiple databases, JSON APIs, and IT security policies: http://rodauth.jeremyevans.net/
Simple file with ActiveAdmin
Am tired to do dirty code in ActiveAdmin! DRY for all. And I made tillge gem, which will cover will simple resources, so you code will be clean, and some simple ActiveAdmin tables will me coded in 1 line. I hope you will like it. Enjoy :) https://github.com/kvokka/active_admin_simple_life