Class: Adminable::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_controllerObject



8
9
10
11
12
13
# File 'lib/generators/adminable/install_generator.rb', line 8

def create_controller
  template(
    'application_controller.rb',
    'app/controllers/adminable/application_controller.rb'
  )
end

#mount_engineObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/adminable/install_generator.rb', line 15

def mount_engine
  insert_into_file(
    "#{Rails.root}/config/routes.rb",
    after: /routes.draw.do\n/
  ) do
    %(  mount Adminable::Engine, at: '/admin'

)
  end
end