Sha256: 2026297f8a8097ff466733d4eb183cd9a4b741536eb2ecea2f6d18e637a72db3
Contents?: true
Size: 852 Bytes
Versions: 40
Compression:
Stored size: 852 Bytes
Contents
module Optimacms module SimpleFormExtensions module ButtonComponents def submit_cancel(*args, &block) template.content_tag :div, :class => "form-group" do template.content_tag :div, :class => "col-sm-offset-1 col-sm-6" do options = args.extract_options! # class options[:class] = [options[:class], 'btn', 'btn-primary', 'btn-lg'].compact # args << options # with cancel link if cancel = options.delete(:cancel) submit(*args, &block) + ' '.html_safe + template.link_to(I18n.t('simple_form.buttons.cancel'), cancel) else submit(*args, &block) end end end end end SimpleForm::FormBuilder.send :include, ButtonComponents end end
Version data entries
40 entries across 40 versions & 1 rubygems