diff options
| author | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-28 12:04:00 +0430 |
|---|---|---|
| committer | Rizwan Reza <rizwanreza@gmail.com> | 2010-03-28 12:04:00 +0430 |
| commit | b4c91de9462f59d6395c7c871aafa3301afdc383 (patch) | |
| tree | fadcaf603a6f473e8ccd52070a1f3b4f957c34cb /railties/lib/rails/generators/erb/controller | |
| parent | 4b4f69b9bfbd33556e23262f57cf6d944dfd9f63 (diff) | |
| parent | 66d57d7ba83df52ff1e0485c89f6192c2f84c6b8 (diff) | |
| download | rails-b4c91de9462f59d6395c7c871aafa3301afdc383.tar.gz rails-b4c91de9462f59d6395c7c871aafa3301afdc383.tar.bz2 rails-b4c91de9462f59d6395c7c871aafa3301afdc383.zip | |
Merge remote branch 'rails/master'
Diffstat (limited to 'railties/lib/rails/generators/erb/controller')
| -rw-r--r-- | railties/lib/rails/generators/erb/controller/controller_generator.rb | 20 | ||||
| -rw-r--r-- | railties/lib/rails/generators/erb/controller/templates/view.html.erb | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/erb/controller/controller_generator.rb b/railties/lib/rails/generators/erb/controller/controller_generator.rb new file mode 100644 index 0000000000..ac57140c23 --- /dev/null +++ b/railties/lib/rails/generators/erb/controller/controller_generator.rb @@ -0,0 +1,20 @@ +require 'rails/generators/erb' + +module Erb + module Generators + class ControllerGenerator < Base + 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 diff --git a/railties/lib/rails/generators/erb/controller/templates/view.html.erb b/railties/lib/rails/generators/erb/controller/templates/view.html.erb new file mode 100644 index 0000000000..cd54d13d83 --- /dev/null +++ b/railties/lib/rails/generators/erb/controller/templates/view.html.erb @@ -0,0 +1,2 @@ +<h1><%= class_name %>#<%= @action %></h1> +<p>Find me in <%= @path %></p> |
