Sha256: b047a904bde2cc79fee49a0e316a05fba2001a0876d7e2970f153104bb922b63

Contents?: true

Size: 565 Bytes

Versions: 32

Compression:

Stored size: 565 Bytes

Contents

require 'rails/generators/erb'

module Erb # :nodoc:
  module Generators # :nodoc:
    class ControllerGenerator < Base # :nodoc:
      argument :actions, type: :array, default: [], banner: "action action"

      def copy_view_files
        base_path = File.join("app/views", class_path, file_name)
        empty_directory base_path

        actions.each do |action|
          @action = action
          @path = File.join(base_path, filename_with_extensions(action))
          template filename_with_extensions(:view), @path
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
railties-4.0.13 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.13.rc1 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.11.1 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.12 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.11 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.10 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.10.rc2 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.10.rc1 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.9 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.8 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.7 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.6 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.6.rc3 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.6.rc2 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.6.rc1 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.5 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.4 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.4.rc1 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.1.0.beta2 lib/rails/generators/erb/controller/controller_generator.rb
railties-4.0.3 lib/rails/generators/erb/controller/controller_generator.rb