Вопрос

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