When learning Ruby, you will find irb (Instant Ruby) to be anexcellent tool -- any time you are not sure about syntax, try it firstin irb.
There are plenty of tutorials on Rails that you can get started with...
Warmly,
Arun