Sha256: 2b9437e934a5fcef17646aa696b28612741737c77f8997ad5b3ebeb563a432c0
Contents?: true
Size: 634 Bytes
Versions: 2
Compression:
Stored size: 634 Bytes
Contents
module Bootstrap::FormHelper def submit_tag(value = "Save changes", options = {}) options = arrayify_class(options.symbolize_keys) class_arg = Array(options.delete(:class)).map(&:to_s) classes = [] classes << 'btn-primary' unless options.delete(:bootstrap) == false || class_arg.detect { |e| e.starts_with?('btn-') } class_arg.each { |e| classes << e } classes << 'btn' if classes.detect { |e| e.starts_with?('btn-') } options = ensure_class(options, classes) options[:disable_with] = "Processing ..." unless options.has_key?(:disable_with) super(value, options) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bootstrap-view-helpers-0.0.3 | app/helpers/bootstrap/form_helper.rb |
bootstrap-view-helpers-0.0.1 | app/helpers/bootstrap/form_helper.rb |