Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/bootstrap_admin/routes.rb
Instance Method Summary collapse
-
#bootstrap_admin(options = {}, &block) ⇒ Object
Defines the routes to the bootstrap_admin controllers of your app and also defines a “admin root” route based on the bootstrap_admin namespace.
Instance Method Details
#bootstrap_admin(options = {}, &block) ⇒ Object
Defines the routes to the bootstrap_admin controllers of your app and also defines a “admin root” route based on the bootstrap_admin namespace
Parameters
options
-
regular route options for the “admin root”
block
-
A block configuring namespaced routes, just like a regular namespace route block
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bootstrap_admin/routes.rb', line 11 def bootstrap_admin = {}, &block admin_namespace = .delete(:namespace) || BootstrapAdmin.admin_namespace BootstrapAdmin.admin_namespace = admin_namespace = BootstrapAdmin.. merge({:controller => admin_namespace.to_s}). merge() resource admin_namespace, if block_given? namespace admin_namespace do block.call end end end |