blob: a8bbcf401c6076e2a976ad5e9eace7f17561c4f7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
require '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, @path = action, File.join(base_path, action)
template filename_with_extensions(:view), filename_with_extensions(@path)
end
end
end
end
end
|