The code to use Active Shipping can go wherever you want in your
application. It could go in one of your controller actions if the
logic to interface your app with the library ends up being simple
enough. Otherwise, you might want to make some kind of model of your
own that encapsulates all of that.
In Shopify, we have an Order model which has a total weight associated
with it, along with a shipping address. The shop also has an origin
address. We construct ActiveMerchant::Shipping::Location objects out
of those addresses and pass them to UPS#find_rates along with an
ActiveMerchant::Shipping::Package object representing the order.
We just use the weight from the order and a fake set of dimensions to
construct the package, but if you want to use real dimensions then you
will want to come up with a packing algorithm of some kind to figure
out how exactly the line items are going to be bundled up into a
smaller number of containers.
The usage examples in the readme show how to construct Locations,
Packages, and Carriers, and how to use the find_rates method once
you've got all of that in place.
Is that any clearer?
-James