active_record (1) cocoon (1) engines (2) jekyll (1) postgresql (1) ransack (2) rspec (1) ruby (1) sidekiq (1) vagrant (1)

active_record (1)

Defining primary and foreign keys in Active Record associations

December 24, 2017

In one of my Rails 4 projects, I found that it was easier to use the source database’s primary and foreign keys. The source database would drop and reuse key...

cocoon (1)

Form Objects and Nesting with Cocoon

October 23, 2016

I created a Form Object (a Ruby class that inherits from ActiveModel::Model) to add multiple records using a single form. I used Sam Slotsky’s Dynamically ad...

engines (2)

Rendering Engine Partials on the Main App

December 10, 2016

As part of the dashboard feature of a web app, I needed to render partials that provide an overview or summary for a particular business area (implemented as...

Routes in Rails Engines

October 30, 2016

My team uses engines because they add functionality in a modular way, and help us avoid the issues that come with bloated models (too many associations or me...

jekyll (1)

Issues with GitHub Pages and Jekyll

October 22, 2016

Configuring Jekyll for GitHub Pages took longer than expected. Instead of linking to Jekyll’s quick start guide, Pages should have pointed me to its set-up i...

postgresql (1)

Connecting to SQL Server from PostgreSQL

December 20, 2017

Foreign data wrappers enable PostgreSQL to access remote SQL databases. I use TDS foreign data wrapper (tds_fdw on GitHub) to connect PostgreSQL, serving as ...

ransack (2)

Pagination for Ransack Forms

November 26, 2016

For pagination to work, you’ll need to submit the desired page number along with the search conditions. In this post, I will discuss how to add pagination fo...

Understanding the Advanced Ransack Demo

October 22, 2016

I keep forgetting how the advanced mode in this demo works, so I end up reviewing the source code every time I need to refresh my memory.

rspec (1)

Testing Concerns with RSpec

October 29, 2016

For an overview, look at this StackOverflow post and then head over to the official RSpec documentation on shared examples. The best option seems to be testi...

ruby (1)

Finding Word Squares

January 29, 2017

I completed a Ruby challenge to find word squares. A (perfect) word square is formed from a group words such that if you arrange them in a square, the same w...

sidekiq (1)

Running Sidekiq as a Linux Service

November 6, 2016

I created a service to manage a single Sidekiq process. Below is my configuration that worked on RedHat Linux 7 using systemd. It is based on this example, a...

vagrant (1)

Using Vagrant for Ruby on Rails development

January 14, 2017

I recently spent time developing a toy Rails 5 app using a Vagrant box. One of my goals is to avoid updating Homebrew. I experienced issues after updates, an...