I have successfully set up the openstreetmap website under the rails port and with integreted versions of Potlatch, Potlatch 2 and iD editors.
I used the OAuth settings to generate a key and now I'am able to add new spatial objects (point, line, polygon) with ID Editor but not to edit my own apidb that I have set up with osmosis
Do I have to create this script myself ? How can I edit an existing apidb the same way like in the openstreetmap public website ?
I would assume that you need to change the URls in https://github.com/openstreetmap/iD/blob/master/js/id/core/connection.js to point to your rails port instance to enable iD to edit your local DB.
However the 2nd part of your question is -very- confusing and would indicate that you are looking at bulk populating the DB which is a different subject.