Github Actions with Rails and Postgres

Github Actions were recently made widely available and this workflow has been awesome. It runs Postgres in a docker container and installs the libpq-dev package for the pg gem. Enjoy! It’s important to note that this configuration runs Postgres inside a docker container with the port forwarded to a random, available port within the build’s […]

Continue Reading

Active Link To Helper

I’m often looking for a flexible solution for determining if I’m on the current route. I say flexible because sometimes a link is bound to a single controller, or sometimes multiple controllers, or multiple controllers with specific actions. Rails Helper Matcher Class Usage The API is somewhat complex to accommodate most use cases. Basic resource […]

Continue Reading

Testing APIs

I recently had the opportunity to test an API and wanted to validate the results along with the structure of the response. When looking around on the internet for inspiration on how to solve this I was intrigued by the wonderful DSL created by Frisby. My goal was to not only test the security and […]

Continue Reading

Using Ransack with HABTM

If you’re unfamiliar with Ransack, it’s basically an advanced search form generator for Rails. It allows you to add fields to the form for things like category_id_eq and title_cont and it will “magically” query the database. The only real problem with Ransack is the lack of documentation. Almost every time I had a problem I […]

Continue Reading

Rails `link_to_with_notification` Helper Method

In with my last post on creating a notification badge I showed the HTML and CSS markup. But I forgot that even when the notification count was at zero it still showed the badge. The Problem Because was using a Rails app I wanted to continue using the link_to helper method. The Solution I created […]

Continue Reading

How I use Markdown with WordPress

I love writing stuff in Markdown. But when I decided to write my blog posts in MD I wanted to have the same syntax as GitHub. In particular fenced code blocks. There are a lot of plugins for WordPress to use MD, but most of them were too complicated for my liking. And they didn’t […]

Continue Reading