21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/generators/backbone/scaffold/scaffold_generator.rb', line 21
def create_view_files
available_views.each do |view|
template "views/#{view}_view.coffee", File.join(backbone_path, "views", plural_name, "#{view}_view.js.coffee")
template "templates/#{view}.jst", File.join(backbone_path, "templates", plural_name, "#{view}.jst.ejs")
end
if options[:single]
available_views.each do |view|
template "views-sp/#{view}_view.coffee", File.join(backbone_path, "views", plural_name, "#{view}_view.js.coffee")
template "templates-sp/#{view}.jst", File.join(backbone_path, "templates", plural_name, "#{view}.jst.ejs")
end
template "views-sp/model_view.coffee", File.join(backbone_path, "views", plural_name, "#{singular_name}_view.js.coffee")
template "templates-sp/model.jst", File.join(backbone_path, "templates", plural_name, "#{singular_name}.jst.ejs")
else
available_views.each do |view|
template "views/#{view}_view.coffee", File.join(backbone_path, "views", plural_name, "#{view}_view.js.coffee")
template "templates/#{view}.jst", File.join(backbone_path, "templates", plural_name, "#{view}.jst.ejs")
end
template "views/model_view.coffee", File.join(backbone_path, "views", plural_name, "#{singular_name}_view.js.coffee")
template "templates/model.jst", File.join(backbone_path, "templates", plural_name, "#{singular_name}.jst.ejs")
end
end
|