Rails, Ruby / 27.04.2020

Here you have a quick example: Let's begin with the service for that. app/services/format_response_with_active_model_errors.rb [ruby] class FormatResponseWithActiveModelErrors extend ActiveModel::Naming def initialize @errors = ActiveModel::Errors.new(self) end def valid? errors.empty? end attr_reader :errors attr_accessor :response def add_error_message!(field_name:,...