Class: CookieLaw::ViewsGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/generators/cookie_law/views_generator.rb', line 7

def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#copy_viewsObject



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

def copy_views
  view_path = Rails.root.join('app', 'views', 'cookie_law')
  # unless Dir.exists? view_path
  #   Dir.mkdir view_path
  # end
  copy_file '_banner.html.erb', view_path.join('_banner.html.erb')
end