Sha256: 6f3e6ff864b3c643695868d29ee5660cf79d83a046298d4cb505f6995e1f1f53

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

<%= application_name.camelize %>::Application.routes.draw do
  devise_for :users, skip: [:session, :password, :registration, :confirmation],
    controllers: { omniauth_callbacks: 'authentications' }

  namespace :admin do
    resources :helps, only: :index
    resource  :settings, only: [:edit, :update]

    resources :users, except: :show do
      collection { post :batch_action }
    end

    resources :versions, only: [:index, :show] do
      collection { post :batch_action }
    end

    resources :pages, except: :show do
      collection { post :batch_action }
      member { put :drop }
      member { post :duplication }
    end

    root to: 'pages#index', as: :root
  end

  devise_for :users, skip: :omniauth_callbacks
  devise_scope :user do
    get 'authentications/new', to: 'authentications#new'
    post 'authentications/link', to: 'authentications#link'
  end

  resources :templates, only: [:index, :show]

  root to: 'index#index'

  begin
    Page.for_routes.group_by(&:behavior).each do |behavior, pages|
      pages.each do |page|
        case behavior
        when nil
        else
          resource( "#{page.class.name.underscore}_#{page.id}",
                    path:       page.absolute_path,
                    controller: behavior,
                    only:       :show,
                    page_id:    page.id )
        end
      end
    end
  rescue
    nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adminos-1.0.0.pre.rc.5 lib/generators/templates/install/routes.rb.erb
adminos-1.0.0.pre.rc.4 lib/generators/templates/install/routes.rb.erb
adminos-1.0.0.pre.rc.3 lib/generators/templates/install/routes.rb.erb
adminos-1.0.0.pre.rc.2 lib/generators/templates/install/routes.rb.erb
adminos-1.0.0.pre.rc.1 lib/generators/templates/install/routes.rb.erb