How to rename rails controller and model in a project

后端 未结 8 1051
遥遥无期
遥遥无期 2020-11-29 17:39

I started a Rails app and everything works fine. But now, I would like to rename a controller and the associated model:

I wanted to change the Corps con

8条回答
  •  自闭症患者
    2020-11-29 17:56

    And if you have model tests, you need to change:

    File rename: corp_test.rb -> store_test.rb (also for controller tests, integration tests, fixture, etc.)

    Code of store_test.rb: Change class CorpTest for class StoreTest.

    And all the references of corp in the controller, model, integration, fixture tests.

提交回复
热议问题