diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-09-24 14:01:31 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-09-24 16:11:41 -0700 |
commit | f0dd77c6be6a86fe384bb0015151e0a497973d39 (patch) | |
tree | ad81bb4c807c39edeaa37035882a16d9d95ebaa9 /railties/lib/generators/erb/scaffold/scaffold_generator.rb | |
parent | 610b81beca461a6fa4f00c7023e0e4315eb2b8be (diff) | |
download | rails-f0dd77c6be6a86fe384bb0015151e0a497973d39.tar.gz rails-f0dd77c6be6a86fe384bb0015151e0a497973d39.tar.bz2 rails-f0dd77c6be6a86fe384bb0015151e0a497973d39.zip |
Move railties/lib/* into railties/lib/*
Diffstat (limited to 'railties/lib/generators/erb/scaffold/scaffold_generator.rb')
-rw-r--r-- | railties/lib/generators/erb/scaffold/scaffold_generator.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/railties/lib/generators/erb/scaffold/scaffold_generator.rb b/railties/lib/generators/erb/scaffold/scaffold_generator.rb deleted file mode 100644 index d51dc7d725..0000000000 --- a/railties/lib/generators/erb/scaffold/scaffold_generator.rb +++ /dev/null @@ -1,53 +0,0 @@ -require 'generators/erb' -require 'generators/resource_helpers' - -module Erb - module Generators - class ScaffoldGenerator < Base - include Rails::Generators::ResourceHelpers - - argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" - - class_option :layout, :type => :boolean - class_option :singleton, :type => :boolean, :desc => "Supply to skip index view" - - def create_root_folder - empty_directory File.join("app/views", controller_file_path) - end - - def copy_index_file - return if options[:singleton] - copy_view :index - end - - def copy_edit_file - copy_view :edit - end - - def copy_show_file - copy_view :show - end - - def copy_new_file - copy_view :new - end - - def copy_form_file - copy_view :_form - end - - def copy_layout_file - return unless options[:layout] - template "layout.html.erb", - File.join("app/views/layouts", controller_class_path, "#{controller_file_name}.html.erb") - end - - protected - - def copy_view(view) - template "#{view}.html.erb", File.join("app/views", controller_file_path, "#{view}.html.erb") - end - - end - end -end |