我收到很多错误如下
Unescaped model attribute near line 20: show_errors(Objective.new(objective_params), :name)
扩展视图
这是我的代码
module ApplicationHelper
# Error Helper for Form
def show_errors(object, field_name)
if object.errors.any? && object.errors.messages[field_name][0].present?
"<label class='text-error'>" + object.errors.messages[field_name][0] + "</label>"
else
return ""
end
end
end