63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/generators/infold/app/app_generator.rb', line 63
def create_view_form_file
@view = @app.app_view_form
return if @view.blank?
base_path = "#{@dist_path}/app/views/#{@ns_snake}"
%w(new edit _form).each do |v|
view_path = File.join(base_path, "#{@app.model.name_pluralize}/#{v}.html.haml")
File.delete(view_path) if File.exist?(view_path)
template "views/#{v}.haml", view_path
end
view_path = File.join(base_path, "#{@app.model.name_pluralize}/new.html+turbo_frame.haml")
File.delete(view_path) if File.exist?(view_path)
template "views/new+turbo_frame.haml", view_path
view_path = File.join(base_path, "#{@app.model.name_pluralize}/edit.html+turbo_frame.haml")
File.delete(view_path) if File.exist?(view_path)
template "views/edit+turbo_frame.haml", view_path
view_path = File.join(base_path, "#{@app.model.name_pluralize}/form.turbo_stream.haml")
File.delete(view_path) if File.exist?(view_path)
template "views/form.turbo_stream.haml", view_path
end
|