Class: ActionTrace::Generators::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/action_trace/views/views_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



13
14
15
# File 'lib/generators/action_trace/views/views_generator.rb', line 13

def self.source_root
  File.expand_path('templates', __dir__)
end

Instance Method Details

#copy_controllerObject



24
25
26
27
28
29
30
31
# File 'lib/generators/action_trace/views/views_generator.rb', line 24

def copy_controller
  return unless options[:controller]

  copy_file(
    File.expand_path('../../../../app/controllers/action_trace/activity_logs_controller.rb', __dir__),
    'app/controllers/action_trace/activity_logs_controller.rb'
  )
end

#copy_viewsObject



17
18
19
20
21
22
# File 'lib/generators/action_trace/views/views_generator.rb', line 17

def copy_views
  directory(
    File.expand_path('../../../../app/views/action_trace', __dir__),
    'app/views/action_trace'
  )
end