abracadabra 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 213cf8616712fda20832054f530234d2026ee52a
4
- data.tar.gz: 8a14ef87204cb4ba575ce6902b0a280518fe940f
3
+ metadata.gz: 0772db47b26302b1a7d1cc017e412547dcd636f0
4
+ data.tar.gz: ac9a933d2cd21b7dcb7b9a829c86fffb948f87b0
5
5
  SHA512:
6
- metadata.gz: 62807428994753c30a7287ff7f6d541963778d5a5b526d16ae5dc7d6b4e2185b783841b4ab2ba0611c1e53ad5edec2d49e365399c2655e8c9e04d3059dd6f657
7
- data.tar.gz: 593595d4f1e71c4b3b435d9a3d05841bc65cc1798ed39535a8bb25dc25d75564023d96ab9fb0b1f798d51444c6df3c1af9a572e541a2d977a169d1195cb2b02e
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 text input of the form. The class
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, method: method.to_sym,
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],
@@ -1,5 +1,5 @@
1
1
  module Abracadabra
2
2
  module Rails
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abracadabra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Hinesley