Interchange characters in Ruby string

Hi friends, In ruby we can interchange characters in a string easily by using “.tr” methods this is a good useful method to perform some replace actions on strings. Returns a copy of str with the characters in from_str replaced by the corresponding characters in to_str. Here are few examples on this method: ‘This isContinue reading “Interchange characters in Ruby string”

Power of PYTHON and RUBY languages

Hi friends, Since last week i had worked with Send SMS via rails application. After long search, i found a site called “” which provides API and sends SMS. This site  is very much helpful in sending automated SMS. They also provide  codes for different languages like “Python, Ruby, PHP, Perl, Java, C, C#, VB.NET”Continue reading “Power of PYTHON and RUBY languages”

Sending SMS via “”

Hi friends, I found a site which sends sms via website and programs. They provides their own API and programing codes in ruby,,c,c#., etc., First we have to signup with our own domain and register with mail-id and phone number. that’s all. 🙂 Ex code in ruby: Now i’m trying to integrate this code into rails3Continue reading “Sending SMS via “””

Constants in Ruby

Hi friends, In ruby, “Constants” holds a constant value for the life of the ruby program. Constants are variables whose names are “Capitalized” or “Upper case”. Ex: Matz = “yukihiro matsumoto” puts Matz # => yukihiro matsumoto if a constant is defined within a “class” or “module”, we can access the constant from within thatContinue reading “Constants in Ruby”

Finding Character code Ruby 1.8.7 and 1.9.2

Hi friends, In Ruby 1.8.7, we can use “?” operator to find the “character code from a character.?a evaluates to the integer 97. Now we can see some examples via “irb” Ex: (ruby 1.8.7) > ?a # it shows character code of “a” => 97 But in Ruby 1.9.2, we can’t use the “?” operator toContinue reading “Finding Character code Ruby 1.8.7 and 1.9.2”

My sample app with new look using rails

Hi friends, Today i finished 5th chapter of Learning rails by example. Today i used some css codes also. 🙂 i deployed my sample app into heroku site. here the link But finally got a problem, still i didn’t clear the problem, the problem is when i usineg ” rspec spec/” to check theContinue reading “My sample app with new look using rails”

My Simple Application using Rails :)

Hi friends, This is the simple and sample application to create using rails and heroku is here. This post mostly covers 3rd part of the “Learn Rails By Example” book. $ rails new sample app -T $ rails generate controller Pages home contact $ gedit Gemfile Edit the file and add the following, The PagesContinue reading “My Simple Application using Rails :)”

Different between “gets” and “gets.chomp” in ruby

Hi friends, The main different between “gets” and “gets.chomp” in ruby is, when you get the input from user, using “gets” method the outputs are ‘ll come like “…/n”. i mean the output ‘ll come whatever you gave and at the same time a “/n” also ‘ll come next to the output, because of whenContinue reading “Different between “gets” and “gets.chomp” in ruby”

Install Rails 3 on Linux Mint 10

Hai Friends, lets see “How to install Rails3 in Linux Mint 10” First we have to install all of the necessary tools and libraries: Install ruby 1.9.2 using RVM: In Linux Mint 10, there is no “.bashrc” file. So we have to create a .bashrc file and add the following line Close your terminal andContinue reading “Install Rails 3 on Linux Mint 10”