thin_man 0.2.0 → 0.3.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 +13 -4
- data/lib/thin_man/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 238921f2707b795300e3d1bc15ac620e4745ea31
|
4
|
+
data.tar.gz: 9751296904c99b41841b8803decf3500dfaa7a8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32a5f3215e3ccb6602c85765d0a3ebd334e2592c1e709458fdb88152495792195adc2b40c012badfae60695aadf8f9f3ca0c9f9fb52e6fe803d7121ab1a9b9ff
|
7
|
+
data.tar.gz: 18773c6115e53078ab7239d364e9e04f2cb83b32e8b3a2a2c9b2864572ea03540fd7c17c1badf05017622196dfb29751336f6c6422da9644844e57c4d17abacb
|
data/lib/thin_man/ajax_helper.rb
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
module ThinMan
|
2
2
|
module AjaxHelper
|
3
3
|
def ajax_link(name, options, html_options, target, sub_class: nil, insert_method: nil)
|
4
|
-
sub_class ||= 'true'
|
5
|
-
insert_method ||= 'html'
|
6
4
|
ajax_options = {
|
7
5
|
'data-ajax-link' => true,
|
8
|
-
'data-ajax-target' => target
|
9
|
-
|
6
|
+
'data-ajax-target' => target
|
7
|
+
}
|
8
|
+
ajax_options.merge!('data-sub-type' => sub_class) if sub_class.present?
|
9
|
+
ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
|
10
|
+
link_to(name,
|
11
|
+
options,
|
12
|
+
html_options.merge(ajax_options))
|
13
|
+
end
|
14
|
+
|
15
|
+
def ajax_delete(name, options, html_options, target, sub_class: nil)
|
16
|
+
ajax_options = {
|
17
|
+
'data-ajax-delete' => true,
|
18
|
+
'data-ajax-target' => target
|
10
19
|
}
|
11
20
|
ajax_options.merge!('data-sub-type' => sub_class) if sub_class.present?
|
12
21
|
link_to(name,
|
data/lib/thin_man/version.rb
CHANGED