From: Peter Hickman Date: 2012-11-29T01:27:12+09:00 Subject: Re: Using model methods without an object for that model --f46d0447f2605fc52904cf90a353 Content-Type: text/plain; charset=ISO-8859-1 The basic RoR practice is to have 'thin' controllers. So the controller would, perhaps, validate / transform params[] then call something to do the work and then quit This sort of thing should be testable with unit tests. Which brings us back to thin controllers. If it results in a model or a class is not a major issue but being able to test things like this with unit tests as opposed to functional tests is. Also your first post is rambling on about something that has nothing to do with the real point of your post which is no one responded to you. Let me summarise what you really asked. Q: "I have a lot of code in my controller because that is where it is called. What are the benefits of moving this out into a sperate module / model / class?" A: "Ease of testing" --f46d0447f2605fc52904cf90a353 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The basic RoR practice is to have 'thin' controllers. So the contro= ller would, perhaps, validate / transform params[] then call something to d= o the work and then quit

This sort of thing should be te= stable with unit tests. Which brings us back to thin controllers. If it res= ults in a model or a class is not a major issue but being able to test thin= gs like this with unit tests as opposed to functional tests is.

Also your first post is rambling on about something tha= t has nothing to do with the real point of your post which is no one respon= ded to you. Let me=A0summarise=A0what you really asked.

Q: "I have a lot of code in my controller because that is where i= t is called. What are the benefits of moving this out into a sperate module= / model / class?"

A: "Ease of testing&q= uot;

--f46d0447f2605fc52904cf90a353--