abracadabra 1.0.6 → 1.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/README.md +5 -1
- data/app/helpers/abracadabra/rails/view_helper.rb +4 -1
- data/lib/abracadabra/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: 0772db47b26302b1a7d1cc017e412547dcd636f0
|
|
4
|
+
data.tar.gz: ac9a933d2cd21b7dcb7b9a829c86fffb948f87b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7059bd2ee97b4b62fa9c75a836a5f164dcd70b66240888499946414759a3467c3799ca40024f8098c07211b3ef96c40678daa0012855ef1d6e2cebf642adfe57
|
|
7
|
+
data.tar.gz: 70cb2ba854378ed4f63729a47069247910592975559e086dee6994a64f1c26d2664dfe4aae6dfbd9d2a1111a0a00560fd769dec26a6eebcd6abc662d26245582
|
data/README.md
CHANGED
|
@@ -61,10 +61,14 @@ attribute: :name
|
|
|
61
61
|
|
|
62
62
|
### OPTIONAL ###
|
|
63
63
|
class: "my-class"
|
|
64
|
-
# Description: Class(es) to be added to the
|
|
64
|
+
# Description: Class(es) to be added to the abracadabra link. The class
|
|
65
65
|
# "abracadabra" is added # either way.
|
|
66
66
|
# Default: only "abracadabra"
|
|
67
67
|
|
|
68
|
+
id: "my-id"
|
|
69
|
+
# Description: ID to be added to the abracadabra link.
|
|
70
|
+
# Default: nil (No ID)
|
|
71
|
+
|
|
68
72
|
value: "blah"
|
|
69
73
|
# Description: An alternate value, other than what object.attribute would return.
|
|
70
74
|
# Default: object.attribute
|
|
@@ -4,6 +4,7 @@ module Abracadabra
|
|
|
4
4
|
def click_to_edit(instance, options)
|
|
5
5
|
instance_class = instance.class.to_s.underscore
|
|
6
6
|
link_class = "#{options[:class]} abracadabra".strip
|
|
7
|
+
link_id = options[:id] || nil
|
|
7
8
|
value = options[:value] || instance.send(options[:attribute])
|
|
8
9
|
method = options[:method] || "patch"
|
|
9
10
|
path = options[:path]
|
|
@@ -33,7 +34,9 @@ module Abracadabra
|
|
|
33
34
|
link_to(
|
|
34
35
|
value,
|
|
35
36
|
"javascript:void(0)",
|
|
36
|
-
class: link_class,
|
|
37
|
+
class: link_class,
|
|
38
|
+
id: link_id,
|
|
39
|
+
method: method.to_sym,
|
|
37
40
|
data: {
|
|
38
41
|
path: path,
|
|
39
42
|
attribute: options[:attribute],
|
data/lib/abracadabra/version.rb
CHANGED