index_for 0.0.6 → 0.0.7
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 +4 -4
- data/lib/index_for/attribute.rb +2 -1
- data/lib/index_for/builders/action_builder.rb +14 -13
- data/lib/index_for/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: 18c31005587f3bedfbab9a622616b09f6a10c7f2
|
|
4
|
+
data.tar.gz: 1a69fafc0bd2ddb8f07c8a122372b4e97c8ad615
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6abd1286e045ccac6e49a459275aa618d270d2d621619c77234742fd640e6d7cbdae69dd6016f22d59a45b536a88e18f09b3f41c1dc71d70e9406453c734c3ac
|
|
7
|
+
data.tar.gz: b0ca84313a529dc5857de9f7b018dc5c4b3d0f860a3a2409b7cc25a49417d4750086c5854783ab2a047afa2d6cd36bd097a237ce16f1dc6e2f50b0f123121cb0
|
data/lib/index_for/attribute.rb
CHANGED
|
@@ -11,20 +11,21 @@ module IndexFor
|
|
|
11
11
|
action_title = translate(:"actions.#{action_name}",
|
|
12
12
|
default: action_name.to_s.humanize).html_safe
|
|
13
13
|
action_html_options = apply_html_options :action_link, options[:html] || {}
|
|
14
|
-
append_class action_html_options, :"action_#{action_name}"
|
|
14
|
+
append_class action_html_options, :"action_#{action_name}", options[:class]
|
|
15
|
+
action_html_options[:data] ||= {}
|
|
16
|
+
action_html_options[:data].reverse_merge!(options.slice(:method, :confirm))
|
|
15
17
|
|
|
16
|
-
case action_name
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
18
|
+
link_path = options[:url] || case action_name
|
|
19
|
+
when :show, :destroy
|
|
20
|
+
@template.polymorphic_path(object)
|
|
21
|
+
else
|
|
22
|
+
@template.polymorphic_path(object, action: action_name)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
action_html_options[:data].reverse_merge!( method: :delete,
|
|
26
|
+
confirm: translate(:"actions.confirmation")) if action_name == :destroy
|
|
27
|
+
|
|
28
|
+
@template.link_to action_title, link_path, action_html_options
|
|
28
29
|
end
|
|
29
30
|
end
|
|
30
31
|
|
data/lib/index_for/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: index_for
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Theo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-09-
|
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|