Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/ceo/rails/routes.rb
Instance Method Summary collapse
-
#admin_for(*rsrcs, &block) ⇒ Object
Public: Generates default admin CRUD routes for resources.
Instance Method Details
#admin_for(*rsrcs, &block) ⇒ Object
Public: Generates default admin CRUD routes for resources.
Returns a route.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ceo/rails/routes.rb', line 9 def admin_for(*rsrcs, &block) = rsrcs. rsrcs.map!(&:to_sym) concern :pageable do collection do get '/page/:page', action: :index, as: 'page' end end [:concerns] = :pageable namespace :admin do rsrcs.each do |r| resources(r, , &block) end end end |