Hello everybody,
By default doing like this:
person = Person.new
person.name = “John”
person.save!
Will cause a new row to be inserted into database. But I don’t want it
to be saved into DB, instead when “save!” method is called I want to
connect to a particular URL and post data to it.
For instance:
POST http://my.app/people/create
“name” => “John”
I need this because I don’t have write access to my DB.
The obvious way to do it is override save, save!, create and delete
methods. but I wonder if there is more convenient way to do it.
Thanks!
Vlad.