Routing Polymorphic Requests Rails -


in rails 3, have several polymorphic models such image , comment, question is,

when makes request create/update/destroy polymorphic object, should request go single controller polymorphic object commentcontroller, or should request routed controller of polymorphic accessor i.e. statuscontroller or imagecontroller?

the pros of single controller more dry , more restful, bad thing feels me couples application more, many things tied 1 single controller. have official answer question?

edit: question not asking route goes, question asking where should route go? semantic solution?

thanks clarification.

you should let comment controller handle crud actions on comments. original argument correct way more dry , restful. logistics comment controller have handle isn't complex, should still left relatively thin comment controller. if still concerned actions in comment controller getting fat, can abstract away of logic writing methods in comment model handle of logic.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -