No need of html_safe here #4289

Merged
merged 4 commits into from Jan 4, 2012

3 participants

@rafaelfranca
Ruby on Rails member

tag helper always return a html safe string and concat two html safe strings always return a html safe string

>> a = "a".html_safe
=> "a"
>> b = "b".html_safe
=> "b"
>> a.html_safe?
=> true
>> b.html_safe?
=> true
>> ab = a+b
=> "ab"
>> ab.html_safe?
=> true
Rafael Mendonça França No need of html_safe here
tag helper always return a html safe string and concat two html safe
strings always return a html safe string
63f48b1
@sikachu
Ruby on Rails member

... But there's a need for test for SafeBuffer. I think it's necessary to test the concatenate using :+ in https://github.com/rails/rails/blob/master/activesupport/test/safe_buffer_test.rb and also adding test to make sure that this indeed yield a html_safe result, to make sure you didn't break anything.

@spastorino
Ruby on Rails member

@rafaelfranca you're right, but yeah agree with @sikachu would be nice to add a test that SafeBuffer + SafeBuffer = SafeBuffer

Rafael Mendo... added some commits Jan 4, 2012
Rafael Mendonça França Add test to make sure that add two safe buffers always return a safe …
…buffer
73a0f9d
Rafael Mendon��a Fran��a Make sure that check_box helper return a safe buffer 8752223
Rafael Mendon��a Fran��a Whitespaces ✂️ 38b9fbf
@rafaelfranca
Ruby on Rails member
@spastorino spastorino merged commit e2e4216 into rails:master Jan 4, 2012
@sikachu
Ruby on Rails member

Awesome, thanks @rafaelfranca :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment