Ruby on Rails

By Hiveminds
Created 2006-09-27 22:50

Installing Running and programming with Ruby on Rails


<?php
# ---
  # Sorting
  # ---
def <=>(other)
    
regex = /^[d]+/
    if 
self.title =~ regex
      our_num 
Regexp.last_match[0].to_i
      
if other.title =~ regex
        other_num 
Regexp.last_match[0].to_i
        
return our_num <=> other_num
      end
    end
    self
.title <=> other.title
  end
?>

<?php
phpinfo
();
?>

printer-friendly version [2]

Source URL: http://www.hiveminds.co.uk/content/ruby-on-rails.html-0