I'm removing some views that are no longer in use and I'm just wondering if it's safe to delete the corresponding js files. For example, if I delete the file

views/admin/products/index.html.erb

Then, is it generally okay to delete the file

public/javascripts/app/views/admin/products/index.js
有帮助吗?

解决方案

It depends on what's inside the js (or coffee) files. So, if you never used the js file, meaning the file has the default text added by rails when the file was first generated, than yes, it's fine to delete. However, if you're including that file in other views because you have some custom code in that file than you should probably extract it elsewhere first.

Also please note, if you delete that file, make sure you're not rendering it in your controllers.

其他提示

It's your wish.If the file doesn't contains any data.you can delete it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top