Sha256: ff441d9cb552a76b5af14b4f60a6b4090e97dd62cfd6e83493ea3834f22e46cc

Contents?: true

Size: 641 Bytes

Versions: 24

Compression:

Stored size: 641 Bytes

Contents

module Trestle
  module Generators
    class AdminGenerator < ::Rails::Generators::NamedBase
      desc "Creates a non-resourceful Trestle admin"

      source_root File.expand_path("../templates", __FILE__)

      def create_admin
        template "admin.rb.erb", File.join("app/admin", class_path, "#{singular_name}_admin.rb")
      end

      def create_template
        template "index.html.erb", File.join("app/views/admin", class_path, singular_name, "index.html.erb")
      end

    protected
      def module_name
        class_name.deconstantize
      end

      def module?
        module_name.present?
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trestle-0.10.1 lib/generators/trestle/admin/admin_generator.rb
trestle-0.10.0 lib/generators/trestle/admin/admin_generator.rb
trestle-0.10.0.pre2 lib/generators/trestle/admin/admin_generator.rb
trestle-0.10.0.pre lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.8 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.7 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.6 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.5 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.4 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.3 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.2 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.1 lib/generators/trestle/admin/admin_generator.rb
trestle-0.9.0 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.13 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.12 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.11 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.10 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.9 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.8 lib/generators/trestle/admin/admin_generator.rb
trestle-0.8.7 lib/generators/trestle/admin/admin_generator.rb