Class: InertiaRails::Generators::ControllerTemplateBase

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

Instance Method Summary collapse

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



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

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



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

def empty_views_dir
  empty_directory base_path
end