Class: BulmaFormRails::Generators::ViewsGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_viewsObject



10
11
12
13
14
15
16
# File 'lib/generators/bulma_form_rails/views_generator.rb', line 10

def copy_views
  gem_directory =  File.join(Gem.loaded_specs['bulma_form_rails'].full_gem_path, 'lib', 'templates', 'app', 'views', 'bulma_form_rails')
  app_directory = File.join('app', 'views', 'bulma_form_rails')
  Dir.each_child(gem_directory) do |template_file| 
    copy_file File.join(gem_directory, template_file), File.join(app_directory, template_file)
  end
end