Avatar
@andrei

Postgres for Rails Development

I've found that the best way to set up Posgres for local development is via Docker, since it has some clear benefits over using system packages on Windows (via WSL2) or Linux.There are three steps to configure Postgres for your Rails application:Install the Postgres serverInstall Postgres libraries for...
Jul 02, 2024
Read more

RESTful Webhooks in Rails

I've recently seen a code sample about working with Stripe webhooks in Rails applications and I've noticed the following code in the controller:class StripeController < ApplicationController skip_before_action :verify_authenticity_token, only: [ :webhook ] def webhook # Sample code for handling Stripe webhook events...
May 02, 2024
Read more

Instance Variable Access in Ruby

Instance variables (or instance attributes) in Ruby are prefixed with an @ sign:class Person def initialize(salutation: nil, first_name:, last_name:) @salutation = salutation @first_name = first_name @last_name = last_name end def name [ @salutation, @first_name, @last_name ].compact.join(" ") endendjohn = Person.new...
Apr 17, 2024
Read more