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.
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.
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 . 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:
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. => [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]
[Screencast] Faye WebSockets - Part 2 - Setting up Faye in Production
Learn how to install and configure a thin server within a Linux environment hosting a Faye WebSocket application. This episode includes showing you how to server your WebSockets over a secure SSL connection. [more inside]
Your Database is Sacred
Ensuring your database starts and stays consistent and valid [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:
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:
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 :)
21 Minutes to Develop a Todo List iOS App with RubyMotion & RedPotion
If you’ve thought about jumping into iOS development with RubyMotion, here’s a video I put together that may help get you started. :) [more inside]
Drifting Ruby Episode 24 - Fragment Caching
Check out a new episode on Drifting Ruby covering performance via Fragment Caching. Make your application faster by leveraging memory and caching fragments of your view.
Ancient City Snake Case
I had the pleasure of attending the Ancient City Ruby Conference last week. The organizers issued the Snake Case Ruby Challenge: to use ruby to count the number of possible paths to walk between opposite corners of a city grid. Though I didn’t win the raffle, I wrote about a few ways to solve this problem and benchmarked the results. https://rossta.net/blog/ancient-city-snake-case.html
How to Compress Responses Using Rack::Deflater On Rails
This articles describes a super simple way to get compressed responses on Rails or any Rack app.
Chat App Implementation without Rails 5 and ActionCable
A lot of people migrated to Rails 5 and its awesome features, but what if you can’t? What if you need to stay on the Rails 4 versions, but still want to build real-time applications. Check out my new blog post :) [more inside]