1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/controllers/targets_controller.rb
2020-06-27 21:52:32 +02:00

25 lines
492 B
Ruby

class TargetsController < ApplicationController
layout 'body_tracking'
menu_item :body_trackers
helper :body_trackers
include Concerns::Finders
before_action :find_project_by_project_id, only: [:index, :new]
def index
prepare_targets
end
def new
@target = (@goal || @project.goals.binding).targets.new
@target.arity.times { @target.thresholds.new }
end
private
def prepare_targets
@targets = @project.targets.includes(:item, :thresholds)
end
end