foxnewsnetwork / American-Lit-315

1 stars 1 forks source link

API controller #22

Open foxnewsnetwork opened 12 years ago

foxnewsnetwork commented 12 years ago

WE DO NOT NEED A SEPARATE API CONTROLLER FOR THIS THING, INDIVIDUAL CONTROLLERS CAN HANDLE IT. KILL THE API CONTROLLER IF IT EXISTS.

SpinnakerSix commented 12 years ago

You mean api methods in the controllers right? everything should be consolidated within the show method?

foxnewsnetwork commented 12 years ago

api methods are well enough encapsulated with the standard new, show, edit, update, create, and destroy methods provided by rails resources. We should use respond_to do |f| end loops to handle xml api calls instead of introduce entirely new objects like an API controller

foxnewsnetwork commented 12 years ago

Well, after doing this for a bit, I guess I take it back, it might be easier and (marginally) more organized if we DID introduce an API resource after all.

SpinnakerSix commented 12 years ago

Hold off until tomorrow? We can get together and talk about this tomorrow.

trevor-umeda commented 12 years ago

May be too late for this, but my 2 cents are to NOT use the api controller.

It's easier to implement and more organized in the short run. In the long run, it would be better to follow the MVC (model view controller) conventions. Early one because there are few amounts of methods to put in, probably not a problem. But because we're breaking away from the conventions for a bit of ease in the beginning, we're setting up risk for the future. Having the controller handle the model concerned is more organized. There are a number of potential backfire situations that could come from using the API controller. Nothing like server crashing or project dooming, but most likely adding unnecessary complexity.

If you feel there the benefits definitely outway this risk, then do it, otherwise it is my advice NOT to utilize the API controller.