Skip to content

Instantly share code, notes, and snippets.

View adamico's full-sized avatar

Andrea D'Amico adamico

  • France
  • 09:17 (UTC +02:00)
View GitHub Profile
@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.