Class: HelpKit::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/generators/help_kit/install/install_generator.rb', line 9

def copy_initializer
  initializer "help_kit.rb", "HelpKit.config do |config|\n# config.site_title is used to display the page titles.\n# config.site_title = \"KnowledgeBase\"\n\n# config.header is used to display the branded text in the header bar on all\n# pages.\n# config.header = '<i class=\"fa fa-book\"></i>Knowledge<strong>Base</strong>'\n\n# config.authorize should check if the current session is capable of editing\n# and managing the help system. If it does not return false or nil article\n# management will be alllowed.\n#  NOTE: If this value is not set managment will always be allowed!\n\n#config.authorize do\n#  User.find(session[:user_id]).is_admin?\n#end\nend\n  FILE\nend\n"

#copy_migrationsObject



5
6
7
# File 'lib/generators/help_kit/install/install_generator.rb', line 5

def copy_migrations
  rake "help_kit:install:migrations"
end

#setup_routesObject



31
32
33
# File 'lib/generators/help_kit/install/install_generator.rb', line 31

def setup_routes
  route %Q|mount HelpKit::Engine => "/kb"|
end