Class: Inertia::Generators::ScaffoldControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
InertiaRails::Generators::Helper, Rails::Generators::ResourceHelpers
Defined in:
lib/generators/inertia/scaffold_controller/scaffold_controller_generator.rb

Overview

This class is a modified copy of Rails::Generators::ScaffoldControllerGenerator. We don’t use inheritance because some gems (i.e. jsbuilder) monkey-patch it.

Instance Method Summary collapse

Methods included from InertiaRails::Generators::Helper

#attributes_to_serialize, #custom_form_attributes, #default_value, guess_inertia_template, guess_the_default_framework, guess_typescript, #inertia_base_path, #inertia_component_name, #inertia_js_version, #inertia_model_form_type, #inertia_model_type, #input_type, #js_edit_resource_path, #js_new_resource_path, #js_resource_path, #js_resources_path, #omit_input_attributes, #ts_type

Instance Method Details

#create_controller_filesObject



26
27
28
29
# File 'lib/generators/inertia/scaffold_controller/scaffold_controller_generator.rb', line 26

def create_controller_files
  template 'controller.rb',
           File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
end