Class: Koi::AdminViewsGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Helpers::AdminGeneratorAttributes, Rails::Generators::ResourceHelpers
Defined in:
lib/generators/koi/admin_views/admin_views_generator.rb

Instance Method Summary collapse

Methods included from Helpers::AdminGeneratorAttributes

#collection_attribute_for, #govuk_input_for, #index_attribute_for, #index_attributes

Instance Method Details

#copy_view_filesObject



21
22
23
24
25
26
# File 'lib/generators/koi/admin_views/admin_views_generator.rb', line 21

def copy_view_files
  available_views.each do |filename|
    target = filename.gsub("record", singular_name)
    template filename, File.join("app/views", controller_file_path, target)
  end
end

#create_root_folderObject



17
18
19
# File 'lib/generators/koi/admin_views/admin_views_generator.rb', line 17

def create_root_folder
  empty_directory File.join("app/views", controller_file_path)
end