Class: BootstrapStyleguide::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routesObject



7
8
9
10
# File 'lib/generators/bootstrap_styleguide/install_generator.rb', line 7

def add_routes
  styleguide_routes = "mount BootstrapStyleguide::Engine => '/bootstrap_styleguide'"
  route styleguide_routes
end

#copy_styleguide_viewsObject



17
18
19
20
# File 'lib/generators/bootstrap_styleguide/install_generator.rb', line 17

def copy_styleguide_views
  styleguide_directory = File.expand_path('../../../app/views/bootstrap_styleguide', __dir__)
  directory styleguide_directory, 'app/views/bootstrap_styleguide'
end

#create_styleguide_layoutObject



12
13
14
15
# File 'lib/generators/bootstrap_styleguide/install_generator.rb', line 12

def create_styleguide_layout
  layout_path = File.expand_path('../../../app/views/layouts/styleguide.html.erb', __dir__)
  copy_file layout_path, "app/views/layouts/styleguide.html.erb"
end