Sha256: d0ac15da90c80a86523c9ba19f26d2803d61b4ee012375a6b5426fc90acb2b66

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

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

module Coalla
  module Cms
    class SetupRoutesGenerator < ActiveRecord::Generators::Base
      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.5.2.4 lib/generators/coalla/cms/setup_routes_generator.rb
coalla-cms-0.5.1.9 lib/generators/coalla/cms/setup_routes_generator.rb
coalla-cms-0.5.1.8 lib/generators/coalla/cms/setup_routes_generator.rb