diff --git a/lib/configurable_engine/configurables_controller_methods.rb b/lib/configurable_engine/configurables_controller_methods.rb index f655f6f..fe00c36 100644 --- a/lib/configurable_engine/configurables_controller_methods.rb +++ b/lib/configurable_engine/configurables_controller_methods.rb @@ -18,7 +18,11 @@ def update if failures.empty? redirect_to(action: :show, :notice => "Changes successfully updated") else - flash[:error] = failures.flat_map(&:errors).flat_map(&:full_messages).join(',') + flash[:error] = failures.map { |c| [c, c.errors] }.flat_map { |c, e| + e.full_messages.map { |m| + "#{c.name} #{m.downcase}" + } + }.join(',') redirect_to(action: :show) end end