Rails 2.1 Generating a RESTful controller?

I've recently made the upgrade to rails 2 and it seems to really encourage restful design now. So I've been looking into that and I am getting the hang of it, but it really bothers me to have to manually setup the REST actions in the controller.

It seems like there should be some way to script/generate restful controller or something for example: script/generate controller posts

would be smart enough to go ahead and include actions (index, show, new, create, edit, update and delete) and also go ahead and fill them out smartly based on the controller name, and knowing that I want a restful controller and that I have a model with the same name.

so it would already have:

def index @posts = Post.find(:all) end

def new @post = Post.new end

etc.

Is there a way to do this?

If not, is this the sort of thing people would usually write a plugin for? Maybe I could look into writing a plugin for it.

I've recently made the upgrade to rails 2 and it seems to really encourage restful design now. So I've been looking into that and I am getting the hang of it, but it really bothers me to have to manually setup the REST actions in the controller.

It seems like there should be some way to script/generate restful controller or something for example: script/generate controller posts

The scaffold generator in rails 2 and above generates a restful
scaffold.

Fred

Thanks, I wondered about that, I haven't generated scaffold since I was first using rails a couple of years ago.

Thanks for the quick reply. Chris