Sha256: c477bc9f263961eea96d787f3879f6c56c6cfa655a9e7eb194267838a52ab443

Contents?: true

Size: 483 Bytes

Versions: 3

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal

class BaseControllerGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('templates', __dir__)
  
  check_class_collision suffix: "Controller"

  desc "This generator creates a base controller for the named namespace"

  def ensure_file
    template "base_controller.rb.erb", 
             File.join("app", "controllers", file_name, "base_controller.rb")
  end
  
  private
  
  
  def namespace_module
    file_name.camelize
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
orthodox-0.3.3 lib/generators/base_controller/base_controller_generator.rb
orthodox-0.3.2 lib/generators/base_controller/base_controller_generator.rb
orthodox-0.3.1 lib/generators/base_controller/base_controller_generator.rb