diff options
Diffstat (limited to 'app/controllers/recipes_controller.rb')
-rw-r--r-- | app/controllers/recipes_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/recipes_controller.rb b/app/controllers/recipes_controller.rb new file mode 100644 index 0000000..bcc29e7 --- /dev/null +++ b/app/controllers/recipes_controller.rb @@ -0,0 +1,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 |