simple_form-magic_submit 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_form/magic_submit.rb +5 -1
- data/lib/simple_form/magic_submit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c2b4fa35c2a5f39e90147adb06366b67464969a
|
4
|
+
data.tar.gz: 9e1f739bc6b5b2dc629bbe9cf1ee7c7bd2e6ba7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] = [
|
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
|
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
|
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-
|
11
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_form
|