提交 ab1bd7cc 编写于 作者: C Carlos Antonio da Silva

Always return an array from formats so there is no need to wrap it when calling

上级 3624ff72
......@@ -6,7 +6,7 @@ class Base < Rails::Generators::NamedBase #:nodoc:
protected
def formats
format
[format]
end
def format
......
......@@ -11,7 +11,7 @@ def copy_view_files
actions.each do |action|
@action = action
Array(formats).each do |format|
formats.each do |format|
@path = File.join(base_path, filename_with_extensions(action, format))
template filename_with_extensions(:view, format), @path
end
......
......@@ -14,7 +14,7 @@ def create_root_folder
def copy_view_files
available_views.each do |view|
Array(formats).each do |format|
formats.each do |format|
filename = filename_with_extensions(view, format)
template filename, File.join("app/views", controller_file_path, filename)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册