Class: InertiaRails::Generators::ScaffoldTemplateBase

Inherits:
ControllerTemplateBase show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/inertia_rails/generators/scaffold_template_base.rb

Instance Method Summary collapse

Methods inherited from ControllerTemplateBase

#empty_views_dir

Methods included from 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

#copy_view_filesObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/inertia_rails/generators/scaffold_template_base.rb', line 15

def copy_view_files
  available_views.each do |view|
    template "#{options.frontend_framework}/#{view}.#{template_extension}",
             File.join(base_path, "#{view}.#{extension}")
  end

  template "#{options.frontend_framework}/#{partial_name}.#{template_extension}",
           File.join(base_path, "#{inertia_component_name}.#{extension}")

  template "#{options.frontend_framework}/types.ts", File.join(base_path, 'types.ts') if typescript?
end