which one tool is best for online cart web application ? ATG or rails(like Agile Webdevelopment has a sample cart application)
Not sure what you mean when you say what tool is best BUT Here is two routes to take:
Beginning Ruby on Rails E-Commerce: From Novice to Professional (http://www.apress.com/book/view/1590597362)
Its old now BUT it is a VERY good start and will get you going from the cart to checkout.
OR us use this: