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.
Raw SQL in a Rails Project
In this blog post I reflect on the idea of writing raw SQL in Rails projects, and present a few tips on housekeeping the SQL code: http://gmile.me/raw-sql-in-a-rails-project
A Decade of Rails
Craig Jolicouer reflects on using Rails for a decade and points out some common gotchas that newcomers experience: http://blog.mojotech.com/a-decade-of-rails
Testing Rails Simple Guide — Part 1
This guide will explain the overview of how to testing rails application in a way everyone can understand. https://designcode.commandrun.com/testing-rails-simple-guide-part-1-33d3d80a83f#.u8miw3iuj
Migrate from Rails 3.x to 4 or 5 with strong parameters
I have created a rake task to help me to migrate a legacy Rails app to strong_parameters. It generates the parameter helper methods for each model. http://meier-online.com/en/2016/01/migration-rails-4-strong-parameters/
Stay Static Showcase Update #2 - New Static Site Samples Incl. Middleman 'n' webgen
Inspired by the TodoMVC showcase I’ve started to put together a static site builder / generator showcase named Stay Static. The idea is to helping you find your static site builder / generator that works best for you. [more inside]
Send Transactional Emails In Rails
To help make your work easier the next time you need to integrate email into your Rails, I’ve compiled the best content on the topic into a 5-part email course.
Improve console print debugging experience
Using awesome_print with tiny improvement as a debugging tool http://undefined-reference.org/2016/01/31/super_awesome_print-as-debugger.html
PostgreSQL Indexes: First Principles
Not really a Ruby related post, but since PostgreSQL is a popular choice among Rubyists, I decided to share this article here. It goes in depth about PostgreSQL indexes and query costs with(out) indexes. Check it out here.
Trailblazer Newsletter, January Edition
Trailblazer is a High-Level Architecture for Ruby consisting of many gems like Cells, Reform and Roar. The January 2016 newsletter talks about Formular (new form builder for Ruby), dry-validation in Reform, Sinatra/TRB, cool but unknown features in Reform and upcoming talks in Europe and Australia.
increment_with_sql v0.0.2 release
For the sake of consistency, use increment_with_sql for ActiveRecord to atomically increment/decrement your counters http://github.com/mrkamel/increment_with_sql
Is 2016 the Year of the static site generators? New sites incl. Rails, EuRuKo, & More
Hello, Is 2016 the year of the static site builders / generators (in Ruby)? The Static Times news channel spotlights some great new static sites on its twitter feed (@statictimes). The latest spotlights include: [more inside]
Replacing Pingdom with Ruby and Heroku
Pingdom recently increased the price of the starting plan from $10 to $14. Since they didn’t keep the price for older customers, I decided to create something to replace it, because the new pricing is just too much for my personal sites. This article shows how you can set up your own uptime checker and run it on Heroku for $7/month.
How to create many-to-many associations in Rails
I wrote an article on the creation of many-to-many relationships with the built-in Ruby on Rails associations, has_many :through and has_and_belongs_to_many:. Additionally, the specific differences between the two will be examined with some use cases. Read more
WhereTZ: find timezone by geocoordinates
New small gem wheretz is fast, doesn’t depend on any external service and return quite precise results.
Search with autocomplete using Twitter Typeahead
Adding simple, easy to customize and reliable autocomplete functionality has always been one of the topics that didn’t seem very clear for Rails applications until one man decided to do some serious research. Read more about his quest to find one solution that could be used without hesitation at http://blog.ragnarson.com/2016/01/25/autocomplete-with-typeahead.html
Contact form gem: EOTS (Email Of The Species)
I’ve written a gem that lets you specify as many kinds of email contact forms as you like, including having them in one or more hierarchies so you can describe their shared fields just once. You use some method calls (see the README) to specify your forms and their fields, set up your SMTP credentials as normal, and EOTS takes care of creating the forms, accepting them, and submitting them to be delivered. See https://rubygems.org/gems/eots for the gem info, https://github.com/davearonson/EOTS for “teh c0dez”, or http://www.Codosaur.us/contact to see examples of the forms. (Please don’t send me emails just to test it!)
Writing a CLI in Ruby with GLI
Building a CLI (command line interface) in Ruby is made easy with the GLI gem. This post shows how it’s done and how it can be integrated into a Rails project.
How to isolate complex queries in an object oriented fashion
Building complex queries in ruby can make your code quite difficult to read, manage and reuse. In this blog post I’ll present a simple method to decorate active record objects to make your queries fun again! [more inside]
How to write a simple web crawler in Ruby - revisited
Revisting an old post on using Ruby to write a simple web crawler, offering another perspective, borrowing ideas from existing libraries, and featuring Ruby’s Enumerator https://rossta.net/blog/how-to-write-a-simple-web-crawler-in-ruby-revisited.html
Stubbing External Services in Rails
Just published a new tutorial on how to stub external services when testing your Ruby on Rails application, for the Semaphore CI Community. Check it out here.
Is Ruby 2.3 Faster? Nested Iterator Performance
In Ruby <= 2.2 iterators like each_with_index, all?, any?, and others are creating extra Ruby objects each time you call them. When these are used inside the loop, they potentially allocate thousands of extra objects, adding more work for the garbage collector. That results in extra GC cycles that, in turn, slow down your application. Find out whether Ruby 2.3 improves this.
Run bundler-audit Regularly on Your Rails Apps with Rake
Rails developers regularly run bundler-audit to alert them to known vulnerabilities in the Ruby gems they depend on. You can run bundler-audit regularly on your Rails projects as part of your default Rake task: https://eliotsykes.com/bundler-audit