In our application we have a number controller actions that have gotten
very long and difficult to maintain. Usually #create and #update. A huge
reason for this is that the objects handled by the controllers have a
bucketload of associations that must be handled according to a complex
set of business requirements.

In short things have gotten complicated and I'm looking for a way to
break up the code in more manageable chunks. I know this is an endeavor
as old as programming itself, but I hope people can share some of their
experiences.

The code i'm dealing with in particular has a lot of error checking. If
this & this then fail. If this but not that then fail, and so forth. Of
course every conditional has various error messages that must be sent
back to client and else clauses and blah blah.

It would be interesting to have some kind of callback system, that
monitors different stages of the #create workflow for example, and when
an error is encountered it bombs out, finds the correct message to
display and returns to view.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to