WIP: #update
This commit is contained in:
parent
aa20931635
commit
316005bf1f
@ -58,8 +58,10 @@ class TargetsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
goal_id = params[:goal][:id]
|
# TODO: DRY same code with #create
|
||||||
goal = goal_id.present? ? @project.goals.find(goal_id) : @project.goals.binding
|
@goal = @project.goals.find(params[:goal_id]) if params[:goal_id].present?
|
||||||
|
@goal ||= @project.goals.new
|
||||||
|
@goal.attributes = goal_params unless @goal.is_binding?
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
Reference in New Issue
Block a user