Class: Terrazzo::Generators::Views::IndexGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Terrazzo::Generators::Views::IndexGenerator
- Includes:
- GeneratedDefaultsHelper, PageMappingHelper
- Defined in:
- lib/generators/terrazzo/views/index_generator.rb
Constant Summary
Constants included from PageMappingHelper
PageMappingHelper::GENERATED_IMPORT_MARKER, PageMappingHelper::GENERATED_MAPPING_MARKER
Constants included from GeneratedDefaultsHelper
GeneratedDefaultsHelper::PAGE_COMPONENTS
Instance Method Summary collapse
Instance Method Details
#copy_index_template ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/terrazzo/views/index_generator.rb', line 20 def copy_index_template if resource.present? eject_json_props copy_resource_page_file "pages/index.jsx", "app/views/#{namespace_name}/#{resource_path}/index.jsx" copy_resource_page_file_unless_exists "pages/_collection.jsx", "app/views/#{namespace_name}/#{resource_path}/_collection.jsx" register_page_mapping("index") else copy_file_over_generated "pages/index.jsx", "app/views/#{namespace_name}/application/index.jsx", generated_content: generated_page_stub("index") copy_file_unless_exists "pages/_collection.jsx", "app/views/#{namespace_name}/application/_collection.jsx" end end |