Change model name in rails easily

好久不见. 提交于 2019-12-13 15:59:05

问题


I'm going to need to change one of my model names. Is there anything out there that will replace every instance of the original model name in the controllers views and tests or do I have to do it all manually, page by page?


回答1:


Check out RubyMine from JetBrains, they have some good refactoring tools for ruby.




回答2:


You have to do all manually, page by page. If you have tests, they should give you clear indications of where it is still in use.




回答3:


Netbeans has this feature, where you can give it a Name you want to change in your entire project and it'll replace it through your entire code base.
Get Netbeans 6.9 beta, the ruby version http://download.netbeans.org/netbeans/6.9/beta/, you just select the model name, right click and pick refactor ... it allows you even preview changes before you run the refactor.



来源:https://stackoverflow.com/questions/2784701/change-model-name-in-rails-easily

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!