Class: Terrazzo::Generators::Views::ShowGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
GeneratedDefaultsHelper, PageMappingHelper
Defined in:
lib/generators/terrazzo/views/show_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_show_templateObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/terrazzo/views/show_generator.rb', line 20

def copy_show_template
  ensure_page_barrels

  if resource.present?
    eject_json_props
    copy_resource_page_file "pages/show.jsx", "app/views/#{namespace_name}/#{resource_path}/show.jsx"
    register_page_mapping("show")
  else
    copy_file_over_generated "pages/show.jsx", "app/views/#{namespace_name}/application/show.jsx",
      generated_content: generated_page_stub("show")
  end
end