Sha256: 5c79ef8d22588fe4b27b06b219c5201ac5287a96d2be26a9af49aaa0b246e258

Contents?: true

Size: 992 Bytes

Versions: 18

Compression:

Stored size: 992 Bytes

Contents

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
edgarj-0.02.00 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.30 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.29 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.28 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.27 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.26 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.25 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.24 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.22 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.21 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.20 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.19 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.18 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.17 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.16 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.15 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.13 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb
edgarj-0.01.12 lib/generators/edgarj/popup_scaffold/popup_scaffold_generator.rb