1

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

4

1 回答 1

2

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.

于 2015-03-02T10:31:02.323 回答