我被困在試圖讓這個幫手正常工作。這是我的,但它肯定不起作用。如何防止Rails助手中的標籤消毒?
def registration_link step, step_number
path = registration_path step
classes = []
classes << 'current' if current_step?(step)
# how do I add the following line to appear before the link ?
step_icon = "<span class='step_number'>#{step_number}</span>"
link_to step_icon + t("registration.menu.#{step}"), path, :class => classes.join(' ')
end
我試圖讓step_icon
到link_to
內,並通過t("registration.menu.#{step}")
看來我有時會在那裏得到所生成的詞前出現,但標籤<>
的消毒以及..
任何想法?
尼斯重構,但仍標籤獲得剝奪.. – Trip 2012-02-17 17:00:18
Content_Tag tothe營救!非常感謝傑西! – Trip 2012-02-17 17:04:22