diff --git a/app/controllers/subprincipleitems_controller.rb b/app/controllers/subprincipleitems_controller.rb index 1afd8e9..8954060 100644 --- a/app/controllers/subprincipleitems_controller.rb +++ b/app/controllers/subprincipleitems_controller.rb @@ -6,14 +6,15 @@ class SubprincipleitemsController < ApplicationController end def update + @redirect_path = helpers.raw("#{company_caf_path(@caf.company, @caf)}##{helpers.dom_id(@subprincipleitem)}") respond_to do |format| if @subprincipleitem.update(subprincipleitem_params) - #redirect_path = helpers.raw("#{company_caf_path(@caf.company, @caf)}/bollox") + #format.html { redirect_to company_caf_path(@caf.company, @caf) , html_options: { target: helpers.dom_id(@subprincipleitem) } , notice: "html" } ##{company_caf_path(@caf.company, @caf)}#subprincipleitem_#{@subprincipleitem.id} #{helpers.dom_id(@subprincipleitem)} #format.json { render :show, status: :ok, location: @company } - format.html { render :update } + format.html { render :update, status: :temporary_redirect} else format.html { render :edit, status: :unprocessable_entity } format.json { render json: @company.errors, status: :unprocessable_entity } diff --git a/app/views/subprincipleitems/update.html.erb b/app/views/subprincipleitems/update.html.erb index 42d40b1..6785255 100644 --- a/app/views/subprincipleitems/update.html.erb +++ b/app/views/subprincipleitems/update.html.erb @@ -1 +1,3 @@ -Bollox +