Search code examples
ruby-on-railsinternationalizationresponders

Rails I18n changes apostrophe to ASCII


I'm using responders gem, and I want to show validation errors when form is not valid. In my controller I created the interpolation_action

def interpolation_options
  { resource_errors: @project_user.errors.full_messages.join(', ') }
end

and my reponders translation file has a proper key:

project_users:
  create:
    notice: "Member has been added"
    alert: "%{resource_errors}"

It works well and I can see validation error message, the problem is that apostrophe is changed to ASCII code.

enter image description here


Solution

  • Does Responder still require you to add the flash in your html? In that case you could do something like <%= flash[:alert].html_safe %> to enforce html on your flash message, even for the escaped characters.