If I have a string: @tmp = “This is a test string 1 2 3 testing…”
and I want to higlight a string “test” when I show it on a page, so how
I can do it?
Result shold be like this: “This is a test string 1 2 3
testing”
If I have a string: @tmp = “This is a test string 1 2 3 testing…”
and I want to higlight a string “test” when I show it on a page, so how
I can do it?
Result shold be like this: “This is a test string 1 2 3
testing”
<%= highlight “your text”, [“test”], “\1” %>
See the ActionView::Helpers::TextHelper#highlight method.
–Jeremy
On Jan 5, 2008 12:23 PM, Gi Ga [email protected] wrote:
–
http://www.jeremymcanally.com/
My books:
Ruby in Practice
My free Ruby e-book
My blogs:
Jeremy McAnally wrote:
See the ActionView::Helpers::TextHelper#highlight method.
Sorry Thanks!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs