blob: bcc29e70156bb47e0ee1074308f39f6c528d10c9 (
plain)
1
2
3
4
5
6
7
8
|
class RecipesController < ApplicationController
def show
@latest = NutrientMeasurement.order(:measured_on).last || NutrientMeasurement.new
@target = TargetNutrientCalculator.call
volume = (params[:volume].presence || 100_000).to_i
@recipe = FertilizerRecipeCalculator.call(@latest, @target, water_volume_l: volume)
end
end
|