I’m working on some search functionality which, depending on parameters sent with the search form, will search different section of a site. This search logic has gotten quite hairy, and I’m looking into different ways of attacking a refactoring.
My current angle is to extract all the slightly hairy logic from the controller into a form object.
In the form object different views can be rendered depending on values in the params hash, and I’m thinking keeping this logic inside the form object could be nice, but I’m not sure about actually performing the rendering there.
My question is thus: What’s your opinion on rendering templates in the form object?