Class: Securial::Generators::Install::ViewsGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_model_viewsObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/securial/install/views_generator.rb', line 12

def copy_model_views
  Dir.glob(File.join(self.class.source_root, "**/*")).each do |path|
    relative_path = Pathname.new(path).relative_path_from(Pathname.new(self.class.source_root))

    if File.directory?(path)
      empty_directory "app/views/securial/#{relative_path}"
    else
      copy_file path, "app/views/securial/#{relative_path}"
    end
  end
end