module RailsAiAdmin::Presentation::Outcomes
One table from stable result codes to the sentence a person reads (RAA-027). The code stays available as secondary text for support, but no page should show a bare code as its explanation.
Constants
- SENTENCES
Public Class Methods
Source
# File lib/rails_ai_admin/presentation/outcomes.rb, line 37 def self.sentence(code) fallback = SENTENCES.fetch(code.to_s) { "The request could not be completed." } return fallback unless code.to_s.match?(/\A[A-Z][A-Z_]{1,63}\z/) I18n.t(code.to_s.downcase, scope: %i[rails_ai_admin outcomes], default: fallback) end
Translatable under rails_ai_admin.outcomes; English is the fallback.