How accept trade works on creating order I want to build a rails application to create buy or sell offer for coins. If buy offer is accepted by seller, How the coins exchanged between the buyer and seller. How can it be implemented? What is the sequence of processes to be done in development level. Is there any opensource projects available in Github. I don't want to use other API's such as cryptsy. Can anybody guide me with proper steps as I am a beginner to cryptocoins.
This "rails application" you would like to create, could be called an "exchange platform". A challenge hereby is to create a secure platform, as you will be taking responsibility for and handling other people's money.

One main difference between exchange platforms is how services facilitate the trade: I am aware of three different modi operandi:


Service only sells crypto. (e.g. Coinbase.com)


The service offers crypto currency at a given price. 
The user accepts the current offer for a specific amount and provides an address where he wants to receive the crypto currency.
The user sends a fiat deposit to the service.
The service waits for the user's payment to clear, then sends the crypto to the user's address.
&nbsp;

Service holds crypto in escrow. (e.g. Bitcoin.de)


User Alice sends a crypto currency deposit to the service.
Alice creates an offer on the service's platform to sell a specific amount of crypto at a certain price.
User Bob accepts Alice's offer.
Bob sends a fiat payment to Alice.
Once Alice receives the payment from Bob, she confirms the payment to the service.
The service sends Alice's crypto currency deposit to Bob, after taking their fees from it.
If something goes wrong, the service mediates the dispute.
&nbsp;

Service holds deposits of all currencies. (e.g. Bitstamp.net)


User Alice sends a crypto currency deposit to the service.
Alice can now create a 


sell offer at a specific price (limit order)
Which will remain in the order book until somebody is willing to pay the price she set.
sell immediately at the current price (market order)
Which will match the best buy offers until her order is matched completely.

Vice versa user Bob sends a fiat deposit to the service.
User Bob can now create a


buy offer at a specific price (limit order)
Which will remain in the order book until somebody is willing to sell for the price he set.
buy immediately at the current price (market order)
Which will match the best sell offers until his order is matched completely.

At any point, Alice and Bob can withdraw their deposits from the service.
You can find a more detailed example at How do buy and sell orders work?



Any of the above should also work for exchanging crypto for crypto.



In order to make the complete platform work, you will need:


User interface, i.e. a website
User management including fulfillment of local KYC, AML laws
Orderbook
Matching engine
Wallets for any tradable crypto currencies
Cold storage for any tradable crypto currencies
Payment processing for fiat currencies, maybe a banking partner
Customer Service
Legal advice


You might also find What would it take to create my own Bitcoin exchange? helpful, which goes more in-depth on the same topic.



Concerning your question for open source Bitcoin exchange software, this question has been answered here: Is there an open source Bitcoin exchange?