Sha256: 581d33e413951f796ab102a297f7506661147618dc063d9adc0b6738af571989

Contents?: true

Size: 739 Bytes

Versions: 2

Compression:

Stored size: 739 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
  end"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coalla-cms-0.4.2.0 lib/generators/coalla/cms/setup_routes_generator.rb
coalla-cms-0.4.4.3 lib/generators/coalla/cms/setup_routes_generator.rb