How to setup a Welcome Email after user confirmation

Override Confirmations controller instructions Ruby on Rails

Using a combo of Ruby on Rails, Devise, Action Mailer and Sidekiq To send a welcome email after a user signs up, you’ll want to override Devise’s RegistrationsController. Here’s how you can do that: In this file, add the following code: The super keyword calls the original create method from Devise::RegistrationsController, and the block (do … Read more

Adding Ahoy gem for first-party Analytics

Asking ChatGPT-4 about ahoy gem testing

The Ahoy gem provides a solid foundation to track visits and events in Ruby, JavaScript, and native apps. Here’s how to add it to a Rails 7 application: This will generate an initializer file at config/initializers/ahoy.rb and a migration file in db/migrate/ which creates two tables, ahoy_visits and ahoy_events. Then you can use the ahoy.track … Read more

Remove WP Branding WordPress Plugin

Remove WP Branding WordPress plugin

This is a WordPress plugin I created a while back to white label, replace and/or remove the WordPress branding from the CMS to give you the user a more professional look if they are doing custom builds with WordPress. The plugin allows you to change the howdy text within the dashboard, hide multiple WordPress logos … Read more

Project has_many Users through

Ruby on Rails code has_many users through

Ruby on Rails tutorial Here is a Ruby on Rails example of adding a join table so that you can create a has_many Users through situation with Projects. This assumes that you already have a Project and a User model. 1. Generate your scaffold: Generating a scaffold here called UserProjects. It has two reference fields … Read more

Add Index to join table with unique checks

migration to add index for join table

Ruby on Rails add index to join table, generate migration 1. make uniqueness index on areas_deals:*This stops the association from being able to be duplicated, but throws an error causing bad UI, we will address that below** 2. Check the schema and make sure you got what you want. We wanted this added: t.index [“area_id”, … Read more

Regex tricks – Change strings to formatted numbers

Regex regular expressions javascript code

(regex == regular expressions) There are a few Regex tricks that I use constantly in my javascript stuff to control numbers or variable names. Here are a few examples of Regex in action. Remove non-numeric characters except periods: This will take a string or number and change it to an integer or a float that … Read more