Skip to content

Instantly share code, notes, and snippets.

View kengreeff's full-sized avatar

Ken Greeff kengreeff

View GitHub Profile
@kengreeff
kengreeff / 20250303023359_create_notification_batches.rb
Created March 4, 2025 00:28
Batch/Debounce Notifications for Noticed Gem
# db/migrate/20250303023359_create_notification_batches.rb
class CreateNotificationBatches < ActiveRecord::Migration[8.0]
def change
create_table :notification_batches do |t|
t.belongs_to :recipient, polymorphic: true, null: false
t.string :key
t.string :delivery_status, default: "pending"
@kengreeff
kengreeff / component.html.erb
Created October 1, 2024 00:31
Rails Form Builder Field Component
<div class="w-full">
<%= component("Form/Label", form: form) { @label } %>
<div class="flex w-full gap-1">
<% if @field_type == :select %>
<%= @form.send(
@field_type,
@attribute_key,
@option_values,
{