Class: InertiaRails::Generators::ControllerTemplateBase

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Helper
Defined in:
lib/inertia_rails/generators/controller_template_base.rb

Constant Summary

Constants included from Helper

Helper::DEFAULT_PACKAGE_PATH

Instance Method Summary collapse

Methods included from Helper

#attributes_to_serialize, #custom_form_attributes, #default_value, guess_inertia_template, guess_the_default_framework, #inertia_base_path, #inertia_component_name, #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, uses_typescript?

Instance Method Details

#copy_view_filesObject



23
24
25
26
27
28
29
# File 'lib/inertia_rails/generators/controller_template_base.rb', line 23

def copy_view_files
  actions.each do |action|
    @action = action
    @path = File.join(base_path, "#{action.camelize}.#{extension}")
    template "#{options.frontend_framework}/#{template_filename}.#{extension}", @path
  end
end

#empty_views_dirObject



19
20
21
# File 'lib/inertia_rails/generators/controller_template_base.rb', line 19

def empty_views_dir
  empty_directory base_path
end