Class: Wallaby::Engine::PartialsGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/wallaby/engine/partials/partials_generator.rb

Overview

‘wallaby:engine:partials` generator

Instance Method Summary collapse

Instance Method Details

#installObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/wallaby/engine/partials/partials_generator.rb', line 11

def install
  destination_prefix = "app/views/#{file_name}/application"
  %w[
    _footer _frontend _logo _navs _title _user_menu
    _index_actions _index_filters _index_pagination _index_query _resource_navs
  ].each do |name|
    copy_file(
      "#{source_paths.first}/app/views/wallaby/resources/#{name}.html.erb",
      "#{destination_prefix}/#{name}.html.erb"
    )
  end
end