Refactoring controllers vs. actions

I just completed an exercise of breaking down an existing project and
mapping out the controllers and actions, then re-factoring them into
some perhaps more RESTful. Though I could be wrong since I am still
grasping REST.

Most of the controllers mapped perfectly into a REST structure, except
for a few.

I have Messages, which can respond to all the usual actions, plus a few
more. The extras are Assign, Transfer, Escalate and Redirect.

My inclination is to simply add the actions to the Message controller,
then map the resources as needed.

Is that the best practice?

On May 21, 10:19 pm, Lon B. [email protected]
wrote:

My inclination is to simply add the actions to the Message controller,
then map the resources as needed.

Is that the best practice?


Posted viahttp://www.ruby-forum.com/.

I found this video really great:

In there he says that roughly, not everything will map and don’t force
it. But before he says that he gives two examples where he needed to
rethink his objects and CRUD.

For example, with your assign. What are you assigning? Are you,
instead, actually creating a relationship between two objects. If so,
then use CRUD (and REST) to create and manage the relationship.

Also, it sounds like Transfer, Escalate, and Redirect are actually
just special cases of update.

But, the main thing I took away from that video is a philosophy of not
forcing anything.

pedz wrote:

On May 21, 10:19 pm, Lon B. [email protected]
wrote:

I found this video really great:

RailsConf Keynote: David Heinemeier Hansson — ScribeMedia

In there he says that roughly, not everything will map and don’t force
it. But before he says that he gives two examples where he needed to
rethink his objects and CRUD.

Thanks. Listening to that talk did help clarify a few my my assumptions.