ruby on rails - Why isn't #truncate including the given block as in the example? -
according documentation, #truncate can accept block, not including it!
http://api.rubyonrails.org/classes/actionview/helpers/texthelper.html#method-i-truncate
2.0.0p247 :310 > helper.truncate("once upon time in world far far away") { link_to "continue", "#" } => "once upon time in world..."
how include block truncate?
rails 3.2.14.
i think block part new in rails 4.0.
http://apidock.com/rails/v3.2.13/actionview/helpers/texthelper/truncate
it looks sort of thing
helper.truncate("once upon time in world far far away", :omission => link_to("continue", "#"))
Comments
Post a Comment