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

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