I set up a simple new rails application with model entry, with attributes title
and content
using scaffolding.
now I am trying to use curl to
To go along with what Jonathan said, the Post is now sending the data to the EntriesController. Now in your create
action you have to get the data from the params
hash. I am going to assume you are doing it the railsy way and so you would do something like this:
curl -d 'entry[content]=I belong to AAA' -d entry[title]=AAA http://localhost:3000/entries'
In your controller
Entry.create(params[:entry])
This says grab the "entry" data from the params hash (created by rails for you) and pass it as a parameter to Entry to initialize a new Object. "create" will do a "new" and "save" for you in one method call.