Class: Gemgento::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routesObject



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

def add_routes
  # routes are inserted in reverse
  route "mount Gemgento::Engine, at: '/'"
  route 'ActiveAdmin.routes(self)'
  route 'devise_for :admin_users, ActiveAdmin::Devise.config'
end

#create_active_admin_assetsObject



27
28
29
30
31
# File 'lib/generators/gemgento/install_generator.rb', line 27

def create_active_admin_assets
  template 'active_admin.rb', 'config/initializers/active_admin.rb'
  template 'active_admin.css.scss', 'app/assets/stylesheets/active_admin.css.scss'
  template 'active_admin.js.coffee', 'app/assets/javascripts/active_admin.js.coffee'
end

#include_application_helperObject



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

def include_application_helper
  inject_into_file Rails.root.join('app', 'controllers', 'application_controller.rb'), before: 'class ApplicationController' do
    <<-'RUBY'
include Gemgento::ApplicationHelper

    RUBY
  end
end