Sha256: 06bcec6324feba27ed4933b7bb26f544bf73145b39c281217d4aa754861b0b2a
Contents?: true
Size: 1.03 KB
Versions: 3
Compression:
Stored size: 1.03 KB
Contents
require 'simple_form' #module WrappedButton # def wrapped_button(*args, &block) # template.content_tag :div, :class => "form-actions" do # options = args.extract_options! # loading = self.object.new_record? ? I18n.t('simple_form.creating') : I18n.t('simple_form.updating') # options[:"data-loading-text"] = [loading, options[:"data-loading-text"]].compact # options[:class] = ['btn-primary', options[:class]].compact # args << options # if cancel = options.delete(:cancel) # submit(*args, &block) + ' ' + template.link_to(I18n.t('simple_form.buttons.cancel'), cancel, :class => 'btn') # else # submit(*args, &block) # end # end # end #end #SimpleForm::FormBuilder.send :include, WrappedButton ::SimpleForm::Inputs::CollectionRadioButtonsInput.class_exec do def item_wrapper_class "radio #{options.delete(:item_wrapper_class)}" end end ::SimpleForm::Inputs::CollectionCheckBoxesInput.class_exec do def item_wrapper_class "radio #{options.delete(:item_wrapper_class)}" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ab_admin-0.1.2 | lib/ab_admin/hooks/simple_form_hooks.rb |
ab_admin-0.1.1 | lib/ab_admin/hooks/simple_form_hooks.rb |
ab_admin-0.1.0 | lib/ab_admin/hooks/simple_form_hooks.rb |