I’m familiar with the phrase “fat model, skinny controller”, but I’m curious if anyone has any questions I can ask myself when deciding to put a method in a controller or model. When should you pick one over the other?
Thank you.
I’m familiar with the phrase “fat model, skinny controller”, but I’m curious if anyone has any questions I can ask myself when deciding to put a method in a controller or model. When should you pick one over the other?
Thank you.
I think of it in terms of “tell don’t ask”. The controller should be full of methods that deal with controller stuff: session
, params
, request
, render
, redirect_to
, and so on. Anything that can be moved out, is.
I also strive to use RESTful controllers as much as possible, which means controllers have up to seven public methods and however many private methods are needed to deal with strong parameters and before_filter
s.