Skip to content

Instantly share code, notes, and snippets.

View ryenski's full-sized avatar
🎯
Focusing

Ryan Heneise ryenski

🎯
Focusing
  • Austin, TX
View GitHub Profile
@lawso017
lawso017 / mentionable_trix.js.coffee
Last active November 14, 2024 14:26
@mentions with trix-editor and selectize.js
window.addEventListener "trix-initialize", (e) =>
Utility.TrixMentions.prepare($(e.target))
@ryenski
ryenski / _row.html.erb
Created January 26, 2018 21:55
Clickable table rows with Stimulus.js
<tr data-action="click->table#click" data-controller="table">
<td> 2018-01-11 </td>
<td>
<a data-target="table.url" href="/invoices/1">$7,000.00</a>
</td>
</tr>
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :authenticate_user!
include CurrentTenant
end
@ryenski
ryenski / activity.rb
Last active December 5, 2018 12:36
Audit trail activity tracker, similar to PaperTrail, but without undo.
# == Schema Information
#
# Table name: activities
#
# id :uuid not null, primary key
# user_id :uuid
# tenant_id :uuid
# trackable_type :string
# trackable_id :uuid