Sha256: 09b155ae266290aaf5f08e8cc75d89f539d419df7bf65b0fc00f008b532531e9
Contents?: true
Size: 649 Bytes
Versions: 7
Compression:
Stored size: 649 Bytes
Contents
module Guts # Routes generator class RoutesGenerator < Rails::Generators::Base # Optional pathname to use for the mount route class_option :pathname, desc: 'The path name for the admin panel', type: 'string', default: '/admin', required: false # Inserts the route into an existing routes file def add_route options[:pathname].insert(0, '/') unless options[:pathname][0] == '/' inject_into_file( 'config/routes.rb', %Q(\n mount Guts::Engine => "#{options[:pathname]}"\n), after: '.routes.draw do' ) end end end
Version data entries
7 entries across 7 versions & 1 rubygems