Sha256: 40edb31d1cba575e6d0dec8ab2c18d3387f6349334b329258c29f6eeecf8d7f0
Contents?: true
Size: 893 Bytes
Versions: 14
Compression:
Stored size: 893 Bytes
Contents
CmAdmin::Engine.routes.draw do controller 'static' do get '/', action: 'dashboard' get '/access-denied', action: 'error_403' end controller 'exports' do post '/export_to_file', action: 'export' end # Defining action routes for each model CmAdmin.config.cm_admin_models.each do |model| if model.importer scope model.name.tableize do send(:get, 'import', to: "#{model.name.underscore}#import_form", as: "#{model.name.underscore}_import_form") send(:post, 'import', to: "#{model.name.underscore}#import", as: "#{model.name.underscore}_import") end end model.available_actions.sort_by {|act| act.name}.each do |act| scope model.name.tableize do send(act.verb, act.path.present? ? act.path : act.name, to: "#{model.name.underscore}##{act.name}", as: "#{model.name.underscore}_#{act.name}") end end end end
Version data entries
14 entries across 14 versions & 1 rubygems