I’m trying to stop worrying and love the crud.
One of the insights I’ve gained so far from the CRUD philosophy in Rails
is to view my domain objects as resources that the client can access.
(Don’t know why, it seems so obvious now, but I never really thought of
a web app quite that way before).
So let’s say I start a new Rails project and I’m about to add my first
resource. I’m on edge rails.
Here’s what I usually do:
- Create the REST controller: ruby script\generate controller Things
index create new show update edit destroy
- Use html verbs: map.resources :things
- Usually, create a model: ruby script\generate Thing
- Edit the Thing migration script as needed
- rake migrate
- rake (just to feel good that all my tests still pass)
- I think DHH demostrated a new generator at Rails Conf in Europe;
anybody know if that’s made it into edge rails yet? If so, how do I use
- Am I missing anything obvious?