diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/table_builder_helper.rb | 2 | ||||
| -rw-r--r-- | app/helpers/table_builder_helper/custom_links.rb | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb index d82f1eb03..897e842a8 100644 --- a/app/helpers/table_builder_helper.rb +++ b/app/helpers/table_builder_helper.rb @@ -157,7 +157,7 @@ module TableBuilderHelper menu = content_tag :ul, class: 'dropdown-menu' do ( - CustomLinks.new(item, pundit_user, links).links + + CustomLinks.new(item, pundit_user, links, referential).links + item.action_links.select { |link| link.is_a?(Link) } ).map do |link| gear_menu_link(link) diff --git a/app/helpers/table_builder_helper/custom_links.rb b/app/helpers/table_builder_helper/custom_links.rb index 4e385b266..b1bb11f10 100644 --- a/app/helpers/table_builder_helper/custom_links.rb +++ b/app/helpers/table_builder_helper/custom_links.rb @@ -8,12 +8,13 @@ module TableBuilderHelper unarchive: :put } - attr_reader :actions, :object, :user_context + attr_reader :actions, :object, :user_context, :referential - def initialize(object, user_context, actions) + def initialize(object, user_context, actions, referential = nil) @object = object @user_context = user_context @actions = actions + @referential = referential end def links @@ -33,10 +34,7 @@ module TableBuilderHelper polymorph_url << action end - polymorph_url += URL.polymorphic_url_parts( - object, - user_context.context[:referential] - ) + polymorph_url += URL.polymorphic_url_parts(object, referential) end def method_for_action(action) |
