How do I use to_sentence for links?
3 answers
ez,
link_to
in Erector goes straight to the output stream. You need to either replace to_sentence
or attack the behavior of link_to, or replace link_to. Since link_to is simple in this context, I would recommend the following:
rawtext users.map { |u|
"<a href='#{user_path(u)}'>#{u.name}</a>"
}.to_sentence
+2
source to share