1
0

Meals index, WIP

This commit is contained in:
cryptogopher
2020-04-18 18:29:53 +02:00
parent 3ff36df168
commit 50b89de904
10 changed files with 90 additions and 55 deletions

View File

@@ -6,7 +6,7 @@ class MealsController < ApplicationController
include Concerns::Finders
before_action :find_project_by_project_id, only: [:index, :new, :create]
before_action :find_meal, only: [:edit, :update, :destroy]
before_action :find_meal, only: [:edit, :update, :destroy, :note, :toggle_eaten]
before_action :authorize
def index
@@ -29,9 +29,18 @@ class MealsController < ApplicationController
end
end
def edit
end
def destroy
end
def note
end
def toggle_eaten
end
private
def meal_params

View File

@@ -33,7 +33,7 @@ class MeasurementsController < ApplicationController
@measurement.routine.project = @project
@routine = @measurement.routine
if @measurement.save
if @routine.exposures.empty?
if @routine.readout_exposures.empty?
@routine.quantities << @measurement.readouts.map(&:quantity).first(6)
end
@@ -83,7 +83,7 @@ class MeasurementsController < ApplicationController
end
def toggle_column
@routine.exposures.toggle!(@quantity)
@routine.readout_exposures.toggle!(@quantity)
prepare_readouts
end