Posts

Showing posts with the label crud

Some Thoughts on CRUD

I sent a helpful PDF on Rails support for CRUD and REST to a buddy of mine. He asked for some clarifications. Here's what I sent to him. Try to think in nouns, and not verbs. Nouns are your Model classes, things which you can have instances of (User, BankAccount, Book, Login). That last example, Login, is where (hopefully) the light bulb goes off. Consider if you could only Create, Read, Update, or Delete *things* (nouns). How would you do a login? One way, the old way, is to add a login method on your user controller. Think about what you're saying. You want to call the method (or *verb*) "login" on User. Already you can see we've left the CRUD methods, and a warning bell should go off. If a user authenticated via User.login, what artifacts are generated? Are you simply returning a boolean? If so, how do you track logins? How do you ask "When was the last time I logged in?" To solve the problem, you noun-ify the concept of login. Create a ...

worldofresources.pdf (application/pdf Object)

Resources on Rails highlights some of the new exciting changes to appear in Rails 1.2. The most exciting is ActiveResource, which CRUDifies models as HTTP resources. Go REST!

Don’t say CRUD say FUC’D.

Don't say CRUD say FUC'D. On how Rails is seeing the true light with CRUD, REST, and HTTP.