require 'rails/generators' module Edgarj class PopupScaffoldGenerator < Rails::Generators::NamedBase include Rails::Generators::ResourceHelpers source_root File.expand_path('../templates', __FILE__) def add_edgarj_routes route "edgarj_popup_resources :#{file_name.pluralize}_popup" end def create_controller_files template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_popup_controller.rb") end =begin hook_for :test_framework, as: :popup_scaffold hook_for :helper, in: :rails, as: :popup_scaffold do |invoked| invoke invoked, [ controller_name ] end =end def create_test template 'functional_test.rb', File.join('test/functional', class_path, "#{controller_file_name}_popup_controller_test.rb") end def create_helper template 'helper.rb', File.join('app/helpers', class_path, "#{controller_file_name}_popup_helper.rb") end end end