Class: ActsAsMultipartForm::Generators::ControllersGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/acts_as_multipart_form/controllers_generator.rb

Overview

Generator for copying the views into the project

Author:

  • Jeremiah Hemphill

Instance Method Summary collapse

Instance Method Details

#copy_or_fetchObject

:nodoc:



18
19
20
21
22
23
# File 'lib/generators/acts_as_multipart_form/controllers_generator.rb', line 18

def copy_or_fetch#:nodoc:
  filename_pattern = File.join self.class.source_root, "*.rb"
  Dir.glob(filename_pattern).map { |f| File.basename f}.each do |f|
    copy_file f, "app/controllers/multipart_form/#{f}"
  end
end