如何使用资源和宁静的协议来改革此代码?
def render_with_hashtags_of_question(text)
text.gsub(TAG_REGEX){
|word| link_to word, "/questions/hashtag/#{word.mb_chars.downcase.delete('#')}"
}.html_safe
end
路线:
get '/questions/hashtag/:name', to: 'questions#hashtags'
非常感谢,伙计们!