def collection
        get_collection_ivar || begin
          c = end_of_association_chain
          set_collection_ivar(c.respond_to?(:scoped) ? c.scoped : c.all)
        end
      end
def collection
        get_collection_ivar || begin
          c = end_of_association_chain
          set_collection_ivar(c.respond_to?(:scoped) ? c.scoped : c.all)
        end
      end
This is how the collection is loaded.

 You might want to overwrite this method if you want to add pagination
 for example. When you do that, don't forget to cache the result in an
 instance_variable:

   def collection
     @projects ||= end_of_association_chain.paginate(params[:page]).all
   end