Class: RailsAppGenerator::AddOns::Views

Inherits:
RailsAppGenerator::Addon show all
Defined in:
lib/rails_app_generator/addons/views.rb

Overview

Add default rails views

Instance Attribute Summary

Attributes inherited from RailsAppGenerator::Addon

#context, #dependencies, #gem_entries

Instance Method Summary collapse

Methods inherited from RailsAppGenerator::Addon

addon_name, dependencies, depends_on, gem, gem_entries, #initialize, required_gem, reset_gem_entries

Constructor Details

This class inherits a constructor from RailsAppGenerator::Addon

Instance Method Details

#applyObject



10
11
12
13
14
15
16
17
18
# File 'lib/rails_app_generator/addons/views.rb', line 10

def apply
  say 'Setting up custom landing page'
  directory 'app/views/layouts', 'app/views/layouts', force: true
  directory 'app/views/shared', 'app/views/shared'
  directory 'app/views/pages', 'app/views/pages' if uses?(:high_voltage)
  # Make sure we can access any images put into the images folder
  inject_into_file('app/javascript/packs/application.js', "require.context('../images', true)")
  directory 'app/javascript/images', 'app/javascript/images'
end