thin_man 0.2.0 → 0.3.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: f694f9976865f2be6904db55f25b9fe67baf5924
4
- data.tar.gz: d86cb2736377c899faa647e912b5b8fe7fcd094f
3
+ metadata.gz: 238921f2707b795300e3d1bc15ac620e4745ea31
4
+ data.tar.gz: 9751296904c99b41841b8803decf3500dfaa7a8b
5
5
  SHA512:
6
- metadata.gz: 7a9dcd0bc13ac90ad5254096bb373922194aa441cd08516cb366bf99585fe938d66500330cd3da90064becadee9187bd898844a231775e50fed434c9f4367324
7
- data.tar.gz: 64e09ecaf6369581877f16ca99e428af4ea7d4ccb2dcab06416a13ede5263cc457c6bfb7b1c7e8e18a8763d717e21a96ac6ce5d3ca4a1cb8f51a684ae2379418
6
+ metadata.gz: 32a5f3215e3ccb6602c85765d0a3ebd334e2592c1e709458fdb88152495792195adc2b40c012badfae60695aadf8f9f3ca0c9f9fb52e6fe803d7121ab1a9b9ff
7
+ data.tar.gz: 18773c6115e53078ab7239d364e9e04f2cb83b32e8b3a2a2c9b2864572ea03540fd7c17c1badf05017622196dfb29751336f6c6422da9644844e57c4d17abacb
@@ -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
- 'data-insert-method' => insert_method
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,
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut, Adam Bialek