Sha256: f2ba35029861c80b4bf202a228ef094315772f2f1be0e86997fa5f085f9ee9ea
Contents?: true
Size: 732 Bytes
Versions: 5
Compression:
Stored size: 732 Bytes
Contents
require 'rails/generators/base' module BulutfonDashboard module Generators class ControllersGenerator < Rails::Generators::Base CONTROLLERS = %w(base).freeze desc '' source_root File.expand_path('../../templates/controllers', __FILE__) class_option :controllers, aliases: "-c", type: :array, desc: "Select specific controllers to generate (#{CONTROLLERS.join(', ')})" def create_controllers scope = 'bulutfon_dashboard' controllers = options[:controllers] || CONTROLLERS controllers.each do |name| template "#{name}_controller.rb", "app/controllers/#{scope}/#{name}_controller.rb" end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems