Class: AdminCore::ResourceRouter
- Inherits:
-
Object
- Object
- AdminCore::ResourceRouter
- Defined in:
- lib/admin_core/resource_router.rb
Class Method Summary collapse
Instance Method Summary collapse
- #edit_path(param) ⇒ String
- #index_path ⇒ String
-
#initialize(resource_manager_class) ⇒ ResourceRouter
constructor
A new instance of ResourceRouter.
- #new_path ⇒ String
- #show_path(param) ⇒ String
Constructor Details
#initialize(resource_manager_class) ⇒ ResourceRouter
Returns a new instance of ResourceRouter.
10 11 12 |
# File 'lib/admin_core/resource_router.rb', line 10 def initialize(resource_manager_class) @resource_manager_class = resource_manager_class end |
Class Method Details
.url_helpers ⇒ Object
5 6 7 |
# File 'lib/admin_core/resource_router.rb', line 5 def self.url_helpers @url_helpers ||= Rails.application.routes.url_helpers end |
Instance Method Details
#edit_path(param) ⇒ String
32 33 34 |
# File 'lib/admin_core/resource_router.rb', line 32 def edit_path(param) url_for(controller: controller, action: 'edit', id: strip(param), only_path: true) end |
#index_path ⇒ String
15 16 17 |
# File 'lib/admin_core/resource_router.rb', line 15 def index_path url_for(controller: controller, action: 'index', only_path: true) end |
#new_path ⇒ String
20 21 22 |
# File 'lib/admin_core/resource_router.rb', line 20 def new_path url_for(controller: controller, action: 'new', only_path: true) end |
#show_path(param) ⇒ String
26 27 28 |
# File 'lib/admin_core/resource_router.rb', line 26 def show_path(param) url_for(controller: controller, action: 'show', id: strip(param), only_path: true) end |