Method: Infold::ShowAssociationsController#update

Defined in:
app/controllers/infold/show_associations_controller.rb

#updateObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/infold/show_associations_controller.rb', line 29

def update
  @show_association = ShowAssociation.find(params[:id])
  @show_association.assign_attributes(post_params)
  if @show_association.save_with_associations
    redirect_to @show_association, flash: { info: t('infold.flash.updated') }
  else
    @view = @show_association.app_view
    Rails.logger.debug "エラー #{@show_association.errors.full_messages}"
    flash.now[:warning] = t('infold.flash.invalid')
    render status: :unprocessable_entity
  end
end