Sha256: ab161daa9bd5a157bb5828fbc28ee2462736d131876cf6be3ebbfa43ea27734e
Contents?: true
Size: 607 Bytes
Versions: 2
Compression:
Stored size: 607 Bytes
Contents
require 'action_dispatch/routing' require 'active_support/concern' module ActionDispatch::Routing class Mapper # Public: Generates default admin CRUD routes for resources. # # Returns a route. def admin_for(*rsrcs, &block) options = rsrcs.extract_options! rsrcs.map!(&:to_sym) concern :pageable do collection do get '/page/:page', action: :index, as: 'page' end end options[:concerns] = :pageable namespace :admin do rsrcs.each do |r| resources(r, options, &block) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ceo-0.2.0 | lib/ceo/rails/routes.rb |
ceo-0.1.7 | lib/ceo/rails/routes.rb |