Sha256: eac51c0610a9083b43be697c33ddb24aa08240459a594762859fd592dca4b8b7

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

require 'rails/generators/named_base'
#require 'generators/coalla/cms/orm_helpers'

module Coalla
  module Cms
    class SetupRoutesGenerator < Rails::Generators::NamedBase
      argument :name, :type => :string, :default => 'administrator'

      def create_route
        route "devise_for :#{name.pluralize}
  devise_scope :#{name} do
    get '/admin' => 'devise/sessions#new'
  end
  namespace :admin do
    scope controller: :image_upload do
      post 'uploads/:image_class/:field' => :upload_image, as: 'upload_image'
    end
    scope controller: :home do
      get :dashboard
    end
    scope controller: :autocomplete do
      get 'list/:model/:field' => :list, as: 'autocomplete'
    end
    get 'notifier/test_sending' => 'notifier#test_sending'
  end"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coalla-cms-0.7.0.0 lib/generators/coalla/cms/setup_routes_generator.rb
coalla-cms-0.6.1.1 lib/generators/coalla/cms/setup_routes_generator.rb
coalla-cms-0.6.0.9 lib/generators/coalla/cms/setup_routes_generator.rb