Skip to content

Instantly share code, notes, and snippets.

@btwelch
btwelch / gist:49d0d8f8dde38fb06c66e980276b0585
Created December 28, 2023 16:09
Active Admin Addons: providing names with context
# /app/admin/api_key.rb
ActiveAdmin.register ApiKey do
include UserFilter
controller do
def permitted_params
params.permit!
end
end
end
@btwelch
btwelch / gist:0e14e3326ef8e8767cae38a6b8e9dea5
Created December 29, 2023 16:52
Simple client interface for javascript, using fetch
export class Client {
Success = 'Success';
Error = 'Error';
async getData(path) {
let fullPath = path;
const result = await fetch(fullPath, {
method: 'GET',
headers: {
Accept: 'application/json',
/*!
* jQuery JavaScript Library v3.7.0
* https://jquery.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2023-05-11T18:29Z
*/