jump to navigation

Generate random number in RUBY January 22, 2008

Posted by amithasija in Ruby on Rails.
Tags: ,
add a comment

size=8
s = “”
size.times { s << (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }
s
@var= s

puts @var

Rails application with different database than mysql January 8, 2008

Posted by amithasija in Ruby on Rails.
Tags: , ,
add a comment

By default when u create a rails application it will be connected to mysql as database but if you want you can make a application that will connect to some other database only at the time of application creation by command:

 

rails –database=oracle test_application