diff --git a/app/views/layouts/cmtool/application.html.slim b/app/views/layouts/cmtool/application.html.slim index a0daacf..7acf864 100644 --- a/app/views/layouts/cmtool/application.html.slim +++ b/app/views/layouts/cmtool/application.html.slim @@ -46,7 +46,7 @@ html lang="en" li.divider - else li[ class=(controller_name == child_item.controller_name ? 'active' : '') ] = link_to child_item.title, child_item.path - - elsif false && menu_item.resource_link? + - elsif menu_item.resource_link? li[ class=(menu_item.controller_name == controller_name ? 'active' : '')]= link_to menu_item.title, menu_item.path .btn-group.pull-right a.btn.dropdown-toggle[data-toggle="dropdown" href="#"] diff --git a/lib/cmtool/menu.rb b/lib/cmtool/menu.rb index 226c9e6..dc4dce4 100644 --- a/lib/cmtool/menu.rb +++ b/lib/cmtool/menu.rb @@ -99,7 +99,7 @@ module Cmtool @resource.model_name.human_plural end def path - engine.routes.url_helpers.url_for(controller: nested_controller_name, action: 'index', only_path: true) + engine.routes.url_helpers.url_for({controller: nested_controller_name, action: 'index', only_path: true}.merge(@options[:path] || {})) end def engine @@ -115,7 +115,7 @@ module Cmtool end def nested_controller_name if @options[:scope].present? - "#{@options[:scope]}::#{@resource.name}".underscore.pluralize + "#{@options[:scope]}::#{@resource.name.split('::').last}".underscore.pluralize else @resource.name.underscore.pluralize end