Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

deptinabellvance Tina Bell Vance Northeast Ohio, USA

Keybase proof

I hereby claim:

@tinabel
tinabel / component.rb
Last active February 2, 2023 21:44
associate label with checkbox
# frozen_string_literal: true
module Form
module Checkbox
class Component < ApplicationComponent
def initialize(name: nil, label: nil, form: nil, attribute: nil, reversed: false, checked: false, value: "1", unchecked_value: "0", error: false, **input_options)
@name = name
@label = label
@form = form
@attribute = attribute
@tinabel
tinabel / zip_service.rb
Last active May 28, 2020 19:33
Ensure that MS Word docx file headers are not corrupted by RubyZip
require 'nokogiri'
require 'zip'
require 'zip/zipfilesystem'
class ZipService
# Initialize with the directory to zip and the location of the output archive.
def initialize(input_dir, output_file)
@input_dir = input_dir
@output_file = output_file
end