effective_resources 0.10.0 → 0.10.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 297715acf66f40c204bce59ebb58873f0499afaa
|
4
|
+
data.tar.gz: b9a0766cc92594a8f6f0cae06bfecd6aefdb24b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa1604c9325e9b8f0259ad4657dd209bc89e9a1dc9dfccdf106a1030f066d77a043896da6c430b19971c15d005bfba401d591c48b4f3057b552c9b83c7ae3d5
|
7
|
+
data.tar.gz: 68077fb078d34ad68d0a5122bcdc56fcddf567969d7a0bb432e8ac95cca6fde7aa56bd70f882c99456ddbe5e70106c9837e417fd0f1797f10ac5504efccce4b4
|
@@ -56,12 +56,12 @@ module Effective
|
|
56
56
|
send(:instance_variable_set, "@#{resource_plural_name}", instance)
|
57
57
|
end
|
58
58
|
|
59
|
-
private
|
60
|
-
|
61
59
|
def effective_resource
|
62
60
|
@_effective_resource ||= self.class.effective_resource
|
63
61
|
end
|
64
62
|
|
63
|
+
private
|
64
|
+
|
65
65
|
def resource_name # 'thing'
|
66
66
|
effective_resource.name
|
67
67
|
end
|
@@ -17,13 +17,15 @@ module EffectiveResourcesHelper
|
|
17
17
|
actions = (controller.respond_to?(:effective_resource) ? controller.class : find_effective_resource).submits
|
18
18
|
actions = permitted_resource_actions(form.object, actions)
|
19
19
|
|
20
|
-
submits = actions.map { |name, opts| form.button(:submit, name, opts.except(:action, :title, 'data-method', 'data-confirm')) }
|
20
|
+
submits = actions.map { |name, opts| form.button(:submit, name, opts.except(:action, :title, 'data-method', 'data-confirm')) }
|
21
21
|
|
22
22
|
# I think this is a bug. I can't override default button class when passing my own class: variable. it merges them.
|
23
23
|
if (btn_class = SimpleForm.button_class).present?
|
24
24
|
submits = submits.map { |submit| submit.sub(btn_class, '') }
|
25
25
|
end
|
26
26
|
|
27
|
+
submits = submits.join(' ').html_safe
|
28
|
+
|
27
29
|
wrapper_options = { class: 'form-actions' }.merge(options.delete(:wrapper_html) || {})
|
28
30
|
|
29
31
|
content_tag(:div, wrapper_options) do
|
@@ -18,7 +18,9 @@ module EffectiveResourcesPrivateHelper
|
|
18
18
|
action = opts[:action]
|
19
19
|
|
20
20
|
# Transform data: { ... } hash into 'data-' keys
|
21
|
-
|
21
|
+
if (data = opts.delete(:data))
|
22
|
+
data.each { |k, v| opts["data-#{k}"] ||= v }
|
23
|
+
end
|
22
24
|
|
23
25
|
# Assign data method and confirm
|
24
26
|
if effective_resource.member_post_actions.include?(action)
|