aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZog2018-01-21 11:59:33 +0100
committerZog2018-01-25 17:18:00 +0100
commite96174ac9c12c89b701307c50e7e1a2b09190316 (patch)
tree218cf5b23d7023fb3dafa28e1e9887baf727e0dc /lib
parentb73fa6fca72590e943ca36265c39f0672765b9aa (diff)
downloadchouette-core-e96174ac9c12c89b701307c50e7e1a2b09190316.tar.bz2
Refs 5586; CR #1
Diffstat (limited to 'lib')
-rw-r--r--lib/af83/decorator/link.rb4
-rw-r--r--lib/af83/enhanced_decorator.rb3
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/af83/decorator/link.rb b/lib/af83/decorator/link.rb
index e7ab90d55..83d40eba8 100644
--- a/lib/af83/decorator/link.rb
+++ b/lib/af83/decorator/link.rb
@@ -136,9 +136,9 @@ class AF83::Decorator::Link
def to_html
if block_given?
- link = Link.new(@options)
+ link = AF83::Decorator::Link.new(@options).bind_to_context(context, @action)
yield link
- return link.bind_to_context(context, @action).to_html
+ return link.to_html
end
if type&.to_sym == :button
HTMLElement.new(
diff --git a/lib/af83/enhanced_decorator.rb b/lib/af83/enhanced_decorator.rb
index ee18686f4..aa9620dba 100644
--- a/lib/af83/enhanced_decorator.rb
+++ b/lib/af83/enhanced_decorator.rb
@@ -45,9 +45,10 @@ module AF83::EnhancedDecorator
def edit_action_link args={}, &block
opts = {
primary: %i(show index),
+ policy: :edit,
before_block: -> (l){
l.content { h.t('actions.edit') }
- l.href { [object] }
+ l.href { [:edit, object] }
}
}
action_link opts.update(args), &block