RailsのScaffoldをステキにするActiveScaffoldで特定のカラムの合計値を表示したいなぁと思ったわけです。 以下のようなテーブルがあるとします。 users id name orders id user_id amount このようなテーブルがあっとしてuser毎のorderのamount合計を表示したいと思ったわけです。 とりあえず二つ方法がある感じです。 (1)userコントローラからorderコントローラをネスト表示してorderコントローラのリストに合計値を表示。 以下のような感じでコントローラーを準備します。 class UsersController < ApplicationController active_scaffold :users do |config| config.nested.add_link("オーダー", [:orders]) end