Verified Commit 528a1aa9 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix some things from review

parent 0002d735
......@@ -3,8 +3,8 @@ class ClientsController < ApplicationController
include NestedAttributes
include ContactAttributes
before_action :set_client, only: [:show, :edit, :update, :destroy, :set_resigned]
before_action :set_social_worker_collection
before_action :set_client, only: [:show, :edit, :update, :set_resigned]
before_action :set_social_worker_collection, only: [:new, :edit]
def index
authorize Client
......@@ -67,8 +67,9 @@ class ClientsController < ApplicationController
def set_resigned
if @client.update(acceptance: 'resigned', resigned_by: current_user)
redirect_to @client, notice: 'Der klient wurde erfolgreich beendet.'
if @client.update(acceptance: :resigned, resigned_by: current_user)
redirect_back(fallback_location: client_path(@client),
notice: 'Klient/in wurde erfolgreich beendet.')
redirect_back(fallback_location: client_path(@client), notice: {
message: 'Beenden fehlgeschlagen.',
......@@ -4,7 +4,7 @@
button.close aria-label='Close' data-dismiss='alert' type='button'
span aria-hidden='true' &times;
= notice || alert
- else
- elsif notice.is_a? Hash
.alert.alert-danger.alert-dismissible role='alert'
button.close aria-label='Close' data-dismiss='alert' type='button' X
h4= notice['message']
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment