Skip to content

Instantly share code, notes, and snippets.

View pacso's full-sized avatar
🤓
React Native at work ... Ruby on Rails at home

Jon Pascoe pacso

🤓
React Native at work ... Ruby on Rails at home
  • Mettle (RBS / NatWest)
  • London, UK
View GitHub Profile
@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
@giacomomacri
giacomomacri / forms_helper.rb
Last active April 11, 2016 13:39
A Simple Custom Form Builder Helper for Twitter Bootstrap 3. The main part of this code is taken from https://coderwall.com/p/x63_qg
# app/helpers/forms_helper.rb
module FormsHelper
# A custom FormBuilder class for Rails forms with Twitter Bootstrap 3
class CustomFormBuilder < ActionView::Helpers::FormBuilder
# ActionView::Helpers::FormHelper and ActionView::Helpers::FormBuilder
# methods each have different args. This hash stores the names of the args
# and the methods that have those args in order to DRY up the method aliases
# defined below.
class ArrayExpander
attr_accessor :replacements
attr_accessor :column_order
def initialize
self.replacements = {}
end