class ActivityNotification::Generators::ControllersGenerator

Controller generator to create customizable controller files from templates. @example Run controller generator for users as target

rails generate activity_notification:controllers users

Constants

CONTROLLERS

Public Instance Methods

create_controllers() click to toggle source

Creates controller files in application directory

# File lib/generators/activity_notification/controllers_generator.rb, line 35
def create_controllers
  @target_prefix = target.blank? ? '' : (target.camelize + '::')
  controllers = options[:controllers] || CONTROLLERS
  controllers.each do |name|
    template "#{name}_controller.rb",
             "app/controllers/#{target}/#{name}_controller.rb"
  end
end
show_readme() click to toggle source

Shows readme to console

# File lib/generators/activity_notification/controllers_generator.rb, line 45
def show_readme
  readme "README" if behavior == :invoke
end