Sha256: 89afbffdefe42eb35a538e4758d4a3a696b7b19773586a3bf89334cc23299ef6

Contents?: true

Size: 657 Bytes

Versions: 11

Compression:

Stored size: 657 Bytes

Contents

module Scrivito
  module Generators
    class PageGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path('../templates', __FILE__)

      def create_model
        template 'model.erb', "app/models/#{file_name}.rb"
      end

      def create_controller
        template 'controller.erb', "app/controllers/#{file_name}_controller.rb"
      end

      def create_views
        copy_file 'index.html.erb', "app/views/#{file_name}/index.html.erb"
        copy_file 'details.html.erb', "app/views/#{file_name}/details.html.erb"
        template 'thumbnail.html.erb', "app/views/#{file_name}/thumbnail.html.erb"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
scrivito_sdk-0.66.0 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.66.0.rc2 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.65.2 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.66.0.rc1 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.65.1 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.65.0 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.65.0.rc2 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.65.0.rc1 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.60.0 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.60.0.rc2 lib/generators/scrivito/page/page_generator.rb
scrivito_sdk-0.60.0.rc1 lib/generators/scrivito/page/page_generator.rb