Forum: Ruby on Rails Redefine standard classes

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Akbar H. (Guest)
on 2007-03-15 06:09
(Received via mailing list)

I need my string in all application (in app directory) has this
"Ruby Is Great".downscore => "ruby_is_great"

So I redefine String class:
class String
  def downscore

The question is where I put this stuff in my ror directory by
convention. Should I put in lib folder or config directory? Right now
waiting your answers, I put it in config/environment.rb.

Thank you.
Russell N. (Guest)
on 2007-03-15 17:14
(Received via mailing list)
You'd put it in your lib directory.

This topic is locked and can not be replied to.