simple_form-magic_submit 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2e10341999a2474e1c06890372f7c5d904d712d
4
- data.tar.gz: 744d9dad06f6efe0b44107a0306990000ad94968
3
+ metadata.gz: 7c2b4fa35c2a5f39e90147adb06366b67464969a
4
+ data.tar.gz: 9e1f739bc6b5b2dc629bbe9cf1ee7c7bd2e6ba7c
5
5
  SHA512:
6
- metadata.gz: 6b996a70a7a96c165d17ed64f1e4bc17808bc2bab5c78b9fe32cd61f5f0bea477a5530a84d030260a2b0117132b0129f7b6f468795febd8702f456ef52980da2
7
- data.tar.gz: d11fff8acddc73fbbc30b1bb8aa07595c9a95ca40be94355212e274d2279ce235a5ead9a749433afca052e3ad99441d65dea8e39a39f049447f3842f1f30dfbb
6
+ metadata.gz: d948b4dda764fb3fea94c1024b26b225a404b3f1c930a6826c9205f65c2f16dc699a003f343416101a333fb94772206c29e384b3fd1db6b468becce208732f53
7
+ data.tar.gz: 75217ff98788cf714dc88a5b2125492c60409460c2bf1a59ec0de290145a3840bccf4c5148a59f3745944159a310bab2d1bad4c6430a201a6c0f8e40bcd39719
@@ -7,7 +7,7 @@ module SimpleForm
7
7
  options = args.extract_options!
8
8
  options[:data] ||= {}
9
9
  options[:data][:disable_with] ||= translate_key(:disable_with)
10
- options[:class] = ['btn-primary', 'btn-submit', options[:class]].compact
10
+ options[:class] = [main_class(options), 'btn-submit', options[:class]].compact
11
11
  options[:id] ||= "submit_#{object_scope}"
12
12
  options[:autocomplete] ||= :off
13
13
  args << options
@@ -22,6 +22,10 @@ module SimpleForm
22
22
  end
23
23
 
24
24
  private
25
+ def main_class(options = {})
26
+ options.fetch(:destructive, false) ? 'btn-destructive' : 'btn-primary'
27
+ end
28
+
25
29
  def controller_scope
26
30
  template.controller.params[:controller].gsub('/', '.')
27
31
  end
@@ -1,5 +1,5 @@
1
1
  module SimpleForm
2
2
  module MagicSubmit
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form-magic_submit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Subbotin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-01 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_form