Refactoring Large Controllers

Hi all,

I’ve got a Ruby on Rails application where I render a lot of RJS stuff
onto a page. Because of this I’ve kept all the logic inside pretty much
one controller.
This controller is now pretty big with lots of functions. I was
wondering what is the best way to refactor it?

I was thinking about moving some methods into a helper module, but it
seems that helpers are for views only. Can a method even render an RJS
file?
What else can I do?

Thanks.

If you have lots of well-factored private methods in your controller,
they’re good candidates to be moved into a model class or some other
class. My buddy, Zach D., put together a nice tutorial for
RailsConf entitled, “Refactoring Your Rails Application.” It was
well-received. More info here:

http://continuousthinking.com/2008/6/3/refactoring-your-rails-application-tutorial-content

Craig

On Tue, Jun 17, 2008 at 6:24 PM, Greg L.