# Restful help: cannot create new record

**URL:** <https://discuss.rubyonrails.org/t/restful-help-cannot-create-new-record/2499>\
**Category:** rubyonrails-talk\
**Created:** [October 3, 2006, 5:24am UTC](https://discuss.rubyonrails.org/t/restful-help-cannot-create-new-record/2499 "2006-10-03T05:24:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmmcgr](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@rmmcgr](https://discuss.rubyonrails.org/u/rmmcgr)\
**Post date:** [October 3, 2006, 5:24am UTC](https://discuss.rubyonrails.org/t/restful-help-cannot-create-new-record/2499/1 "2006-10-03T05:24:34Z")

</div>

Hi,

I have got edge rails (as of 03 October) and tried to get a new app I am building to use the new Restful approach. Followed the examples in Agile Web Development (2nd Ed) and issued a "scaffold\_resource" command for my model.

However when I attempt to create a new record, and click "create", it just goes back to the index view for the model. What might I be doing wrong?

Steps were: 1. Created table via migrations (all worked well, table created ok. Using Sqlite3). 2. Issued the command "ruby script/generate scaffold\_resource \<mymodelname\>" 3. Put the line in the routes.rb file, "map.resources :\<mymodelname\>".

Then tried to run it and found the problem where it wont add anything.

Thanks for any help, Richard

---

<div class="post-metadata">

**Author:** ![Jamie\_Orchard-Hays1](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jamie\_Orchard-Hays1](https://discuss.rubyonrails.org/u/Jamie_Orchard-Hays1)\
**Post date:** [October 3, 2006, 1:48pm UTC](https://discuss.rubyonrails.org/t/restful-help-cannot-create-new-record/2499/2 "2006-10-03T13:48:27Z")

</div>

Can you show some code? What's in the controller for create? What is the rhtml code for the form?

Also, your resources should be plural, like a table name:

map.resources :guitars

This link has been the most helpful for me: [http://david.goodlad.ca/articles/2006/08/02/simply\_restful-in-rails-core](http://david.goodlad.ca/articles/2006/08/02/simply_restful-in-rails-core)
