You can now indicate that you have completed something and add evidence but the update doesn't yet work and it will need refatoring because we need to get back to the CAF or company.
This commit is contained in:
28
app/controllers/subprincipleitems_controller.rb
Normal file
28
app/controllers/subprincipleitems_controller.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class SubprincipleitemsController < ApplicationController
|
||||
before_action :set_subprincipleitem, only: %i[ edit update ]
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @subprincipleitem.update(subprincipleitem_params)
|
||||
format.html { redirect_to company_url(@company), notice: "Company was successfully updated." }
|
||||
format.json { render :show, status: :ok, location: @company }
|
||||
else
|
||||
format.html { render :edit, status: :unprocessable_entity }
|
||||
format.json { render json: @company.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def set_subprincipleitem
|
||||
@subprincipleitem = Subprincipleitem.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def subprincipleitem_params
|
||||
params.require(:subprincipleitem).permit(:affirmative)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user