We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 68e5623 + ca9c810 commit 89c6cb8Copy full SHA for 89c6cb8
2 files changed
lib/sync/partial.rb
@@ -30,7 +30,7 @@ def sync(action)
30
end
31
32
def message(action)
33
- Sync.client.build_message channel_for_action(action),
+ Sync.client.build_message channel_for_action(action),
34
html: (render_to_string unless action.to_s == "destroy")
35
36
@@ -71,8 +71,7 @@ def path
71
72
def locals
73
locals_hash = {}
74
- locals_hash[resource.name.to_sym] = resource.model
75
-
+ locals_hash[resource.base_name.to_sym] = resource.model
76
locals_hash
77
78
lib/sync/resource.rb
@@ -51,6 +51,10 @@ def id
51
def name
52
model.class.model_name.to_s.underscore
53
54
+
55
+ def base_name
56
+ name.split('/').last
57
+ end
58
59
def plural_name
60
name.pluralize
0 commit comments