ruby on rails 3 - Looking for a override of SafeBuffer -
i reading katz's safe buffer article while trying upgrade our side rails 3. have lot of helpers build complex html/css bits data know safe (we're doing things large menus).
unfortunately - if i'm reading katz's article right - seems need mark html_safe or escaped.
i'm wondering if has come simple hack turn functionality off on module/method/block level yet? looking @ code in rails , doesn't trivial override.
i believe have couple "easy" solutions:
- modify helpers hand return
html_safe
'd strings - iterate on methods (module?) , use
alias
alias them to, say,_unsafe_helper_name
, , havehelper_name
return_unsafe_helper_name.html_safe
- use
raw
method in views. callingraw
on output turns off rails 3's built in protection , outputs string no escaping.
Comments
Post a Comment