class ActiveAdmin::Renderer

def call_method_or_proc_on(obj, symbol_or_proc)


call_method_or_proc_on(@my_obj, proc)
proc = Proc.new{|s| s.size }
OR
call_method_or_proc_on(@my_obj, :size) same as @my_obj.size

method takes care of this functionality.
or instance_exec a proc passing in the object as the first parameter. This
Many times throughout the views we want to either call a method on an object
def call_method_or_proc_on(obj, symbol_or_proc)
  case symbol_or_proc
  when Symbol, String
    obj.send(symbol_or_proc.to_sym)
  when Proc
    instance_exec(obj, &symbol_or_proc)
  end
end