thin_man 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thin_man/ajax_helper.rb +10 -6
- data/lib/thin_man/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: 6d59918aacb9231e5137e3381c7d75005463ca32
|
4
|
+
data.tar.gz: 00e5a610ba4939e0d39e038445bfe14f6522b332
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 731f872d5217d28f8ad3494720aae2576590030cf0c156ab366ace4a41c56795bad64091ae9bbcba5e061e38e993da30a5988d1c8c0428c4eeba93d69362a537
|
7
|
+
data.tar.gz: d39ef7ff7d292a2ef58fe875b9878f7b10fac4c0514126e50e15ebf61a8be6f2a27f9b70d8d8bbb3dc9e436be6e2590341a5e60ce20aa89cc144501b338d18ca
|
data/lib/thin_man/ajax_helper.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module ThinMan
|
2
2
|
module AjaxHelper
|
3
|
-
def ajax_link(name, options, html_options, target, sub_class: nil, insert_method: nil)
|
3
|
+
def ajax_link(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil)
|
4
4
|
ajax_options = {
|
5
5
|
'data-ajax-link' => true,
|
6
6
|
'data-ajax-target' => target
|
7
7
|
}
|
8
8
|
ajax_options.merge!('data-sub-type' => sub_class) if sub_class.present?
|
9
9
|
ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
|
10
|
+
ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
|
10
11
|
link_to(name,
|
11
12
|
options,
|
12
13
|
html_options.merge(ajax_options))
|
@@ -23,20 +24,23 @@ module ThinMan
|
|
23
24
|
html_options.merge(ajax_options))
|
24
25
|
end
|
25
26
|
|
26
|
-
def ajax_form_hash(target, sub_class: nil, insert_method:
|
27
|
+
def ajax_form_hash(target, sub_class: nil, insert_method: nil, error_target: nil, empty_on_success: nil)
|
27
28
|
ajax_options = {
|
28
29
|
'data-ajax-form' => true,
|
29
|
-
'data-ajax-target' => target
|
30
|
-
'data-insert-method' => insert_method
|
30
|
+
'data-ajax-target' => target
|
31
31
|
}
|
32
|
+
ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
|
32
33
|
ajax_options.merge!('data-sub-type' => sub_class) if sub_class.present?
|
34
|
+
ajax_options.merge!('data-error-target' => error_target) if error_target.present?
|
35
|
+
ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
|
33
36
|
ajax_options
|
34
37
|
end
|
35
38
|
|
36
|
-
def ajax_link_attrs(target, insert_method: nil, sub_type: nil)
|
39
|
+
def ajax_link_attrs(target, insert_method: nil, sub_type: nil, empty_on_success: nil)
|
37
40
|
data_attrs = "data-ajax-link=true data-ajax-target=#{target}"
|
38
41
|
data_attrs += " data-insert-method=#{insert_method}" if insert_method
|
39
|
-
data_attrs += " data-
|
42
|
+
data_attrs += " data-sub-type=#{sub_type}" if sub_type
|
43
|
+
data_attrs += " data-empty-on-success=#{empty_on_success}" if empty_on_success
|
40
44
|
data_attrs
|
41
45
|
end
|
42
46
|
|
data/lib/thin_man/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thin_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut, Adam Bialek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|