EastsideDev
EastsideDev

Reputation: 6639

Using a single large controller or multiple controllers

Rails 3.2
Ruby 2.1.5

I am working on an application to create tickets (service orders). A ticket is going to have a number of sections. Rather than create a single large controller, would it be better if I had multiple controllers/models, one for each section of the ticket, and have a single view to display the sections in a single form?

I would also have a views/tickets/shared set of views (one for each section), and from the main view, I would render each as needed inside a div in the main view.

Upvotes: 0

Views: 74

Answers (1)

user2602252
user2602252

Reputation:

You should use multiple controller for an application like this until you know the controller object will start to violate the Single Responsibility principle, making future changes to the code base difficult and error-prone.

Upvotes: 1

Related Questions