Feature #42073 » fix-render_flash_messages-to-ignore-non-string-flash-values-and-prevent-errors.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
def render_flash_messages
|
||
|
s = +''
|
||
|
flash.each do |k, v|
|
||
|
next unless v.is_a?(String)
|
||
|
s << content_tag('div', notice_icon(k) + v.html_safe, :class => "flash #{k}", :id => "flash_#{k}")
|
||
|
end
|
||
|
s.html_safe
|
||
| test/helpers/application_helper_test.rb | ||
|---|---|---|
|
assert_equal expected, format_activity_description(text)
|
||
|
end
|
||
|
def test_render_flash_messages_should_ignore_non_string_values
|
||
|
flash[:array_value] = ['1', '2']
|
||
|
flash[:hash_value] = { foo: 'bar' }
|
||
|
result = render_flash_messages
|
||
|
assert_equal '', result
|
||
|
end
|
||
|
private
|
||
|
def wiki_links_with_special_characters
|
||
- « Previous
- 1
- 2
- 3
- Next »