<repo_name>johnantoni/simple_form_ext<file_sep>/lib/simple_form_ext.rb
require "simple_form_ext/version"

require 'find'

dir = File.expand_path("simple_form_ext/ext", File.dirname(__FILE__))

Find.find(dir) do |path|
  next if File.extname(path) != ".rb"
  require path
end
<file_sep>/lib/simple_form_ext/ext/radio_buttons_left_label_input.rb
# example
# <%= form.input :gender, :as => :radio_buttons_left_label, :collection => %w[Female Male] %>

class RadioButtonsLeftLabelInput < SimpleForm::Inputs::CollectionRadioButtonsInput
  def input
    label_method, value_method = detect_collection_methods

    @builder.send("collection_radio_buttons",
      attribute_name, collection, value_method, label_method,
      input_options, input_html_options, &collection_block_for_nested_boolean_style
    )
  end

  protected

  def build_nested_boolean_style_item_tag(collection_builder)
    collection_builder.text.html_safe + collection_builder.radio_button.html_safe
  end
end

