Paulo Pereira
2008-Feb-16 19:20 UTC
TypeError in highlight (ActionView::Helpers::TextHelper)
I was trying to highlight more than 1 term in a text with highlight method from TextHelper. Much to my surprise, I just copied the example from Rdoc (http://api.rubyonrails.org/classes/ActionView/Helpers/ TextHelper.html#M001050): highlight(''You searched for: rails'', [''for'', ''rails''], ''<em>\1</em>'') But I get TypeError. C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/ helpers/text_helper.rb:48:in `escape'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/ helpers/text_helper.rb:48:in `highlight'' Then I updated to Rails 2.0.2 (gem update rails -y ). But still doesn''t work. On the two lines above, the path is ...actionpack-1.13.6 ... what do I need to do to work with actionpack 2.0.2? I''m working with netbeans for win XP Thanks in advance, Paulo Pereira --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Feb-18 11:49 UTC
Re: TypeError in highlight (ActionView::Helpers::TextHelper)
On 16 Feb 2008, at 19:20, Paulo Pereira wrote:> > I was trying to highlight more than 1 term in a text with highlight > method from TextHelper. Much to my surprise, I just copied the example > from Rdoc (http://api.rubyonrails.org/classes/ActionView/Helpers/ > TextHelper.html#M001050): highlight(''You searched for: rails'', > [''for'', ''rails''], ''<em>\1</em>'') > > But I get TypeError. > > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/ > helpers/text_helper.rb:48:in `escape'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/ > helpers/text_helper.rb:48:in `highlight'' > > Then I updated to Rails 2.0.2 (gem update rails -y ). But still > doesn''t work. On the two lines above, the path > is ...actionpack-1.13.6 ... what do I need to do to work with > actionpack 2.0.2? >You''re environment.rb probably says something like RAILS_GEM_VERSION = ''1.2.5'' unless defined? RAILS_GEM_VERSION Change that to the version of rails you want to use. Don''t forget to run rake rails:update Fred> I''m working with netbeans for win XP > > Thanks in advance, > > Paulo Pereira > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---