Burning the candle at both ends, I see from the timestamp of your last
message 
You’ve helped me alot, Aaron…and thank you for that.
As you have pointed out…defining highlight in my CSS works perfectly.
In fact, I found that as soon as I defined it, the following statement
works:
<%= highlight(‘this is simple text’, ‘text’) %>
And I didn’t have to add the part although
that worked as well.
The last question I have is what happens when I want to highlight more
than one word if it appears in my variable?
For instance, I have a variable that contains a date, what I need to be
able to do is highlight Thu when it’s Thursday but always highlight
2008.
This works to always highlight 2008:
<%= highlight(trap.datetime.to_s, ‘2008’) %>
I was hoping I could do something like this but it doesn’t work because
it looks for both of them in a string:
<%= highlight(trap.datetime.to_s, ‘Thu, 2008’) %>
What I’m actually trying to accomplish here, is to highlight certain
words in my network traps in red. For instance, if I got a trap that
contained the word “BGP”, I want that highlighted in red as well as if
the word “Spanning-tree” is contained in the trap. This is why I was
hoping to be able to specify several words to be highlighted if they
exist in my variable.
thanks alot Aaron,
jackster
Aaron C. wrote:
On Jan 30, 10:11 pm, jackster the jackle <rails-mailing-l…@andreas-
s.net> wrote:
The only issue I have is that it makes the text strong bold…what I
need is to make it highlighted in red or other colors…I don’t see
anything in the doco to do that.
As stated in the docs, you can specialize the highlighter by providing
a value for the 3rd argument. The default is to highlight using
text, but you can get the effect you want by doing something
like:
<%= highlight(‘this is sample text’, ‘text’, '<span class=‘highlight">
\1’) %>
and adding this to your CSS file:
.highlight {color: red}