Class: LotusAdmin::Router
- Inherits:
-
Object
- Object
- LotusAdmin::Router
- Defined in:
- lib/lotus_admin/router.rb
Instance Method Summary collapse
- #define(&block) ⇒ Object
- #install(router, at: 'admin') ⇒ Object
- #resource_routes ⇒ Object
- #resources(router) ⇒ Object
Instance Method Details
#define(&block) ⇒ Object
15 16 17 |
# File 'lib/lotus_admin/router.rb', line 15 def define(&block) resource_routes.push(block) end |
#install(router, at: 'admin') ⇒ Object
3 4 5 6 7 |
# File 'lib/lotus_admin/router.rb', line 3 def install(router, at: 'admin') router.devise_for :administrators, devise_config router.mount LotusAdmin::Engine, at: at end |
#resource_routes ⇒ Object
19 20 21 |
# File 'lib/lotus_admin/router.rb', line 19 def resource_routes @resource_routes ||= [] end |
#resources(router) ⇒ Object
9 10 11 12 13 |
# File 'lib/lotus_admin/router.rb', line 9 def resources(router) resource_routes.each do |routes| router.instance_eval(&routes) end end |