How do you parse text in Ruby on Rails and add classes to specific parts of it?
Posted
by codyvbrown
on Stack Overflow
See other posts from Stack Overflow
or by codyvbrown
Published on 2010-05-23T00:32:47Z
Indexed on
2010/05/23
0:40 UTC
Read the original article
Hit count: 261
ruby-on-rails
I am a Rails novice and I'm creating an application that I'd love some help on. The app is for social reading. It enables a user to highlight a passage from a text then have that passage saved and bolded into the view for later reading by anyone else.
I have no problem creating an if statement on whether a certain string of text is in a passage but how do I add a class to that string and have a group of these passages absorbed back into the view. Any strategic advice would be greatly appreciated.
© Stack Overflow or respective owner