rails calculator