Home>

I am creating an application with Rails on Windows 10.

Among them, it is divided into frameworks such as user and admin, and each controller and view directory exists under that directory.

Now, I want to change the directory name in the first hierarchy later. How can I change the directory name?

Example

app/controllers/seller/each controller

app/views/seller/each view

I want to change the name "seller" here.

When creating
rails g controller seller/controller name
Created in.

At the beginning, I remember that an error occurred when I renamed directly by right-clicking, so please tell me the proper way!

  • Answer # 1

    For view, you only need to modify the directory name, but for controller, that is not enough.
    For example, suppose you change seller to shop
    1 in conntrollers /shop/some_controller.rb
    I think it's class Seller :: SomeCntrller
    Change it to class Shop :: SomeController.

    2 Change seller, sellers in routes.rb to shop, shops