Should frontend and backend be handled by different controllers?

后端 未结 4 402
自闭症患者
自闭症患者 2021-02-01 09:52

In my previous learning projects I always used a single controller, but now I wonder if that is good practice or even always possible.

In all RESTful Rails tutorials the

4条回答
  •  攒了一身酷
    2021-02-01 10:38

    When I need a clearly separated administration area, I tend to go for a solution with two controllers for one resource. An Admin::BooksController in the admin/ sub directory for the admin interface with all actions and a public BooksController that only has index and show methods depending on needs.

提交回复
热议问题