Sha256: 4424cb2e4cc80ce3634722ad1ac0a14df3f79a9fca006f14d8d2eb788887ab1a

Contents?: true

Size: 248 Bytes

Versions: 8

Compression:

Stored size: 248 Bytes

Contents

# Using Biogem with Rails

class String
  # Handle underscore in routing template
  def underscore
    self.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    tr("-", "_").
    downcase
  end
end


Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bio-gem-1.3.6 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.5 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.4 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.3 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.2 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.1 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.3.0 lib/bio-gem/mod/biogem-rails.rb
bio-gem-1.2.2 lib/bio-gem/mod/biogem-rails.rb