Saturday, October 28, 2006

RoR-1: Ruby On Rails

http://www.ruby-doc.org/gettingstarted/
跟Java比較,學Ruby只要兩本書喔!

http://anw.stikipad.com/ocean/show/WhyRails

跟Apache, Mysql 一起打包的安裝程式
http://instantrails.rubyforge.org/

Learn Ruby Online
http://tryruby.hobix.com/
http://www.javaeye.com/topic/19341

>> [1,3,2].sort
=> "My toast has flown from my hand\nAnd my toast has gone to the moon.\
nBut when I saw it on television,\nPlanting our flag on Halley's comet,\
nMore still did I want to eat it.\n"

>> [1,3,2].sort!
=> [1, 2, 3]
//陣列可以直接+,-
>> [1,2]+[3]
=> [1, 2, 3]
>> [1,2]-[1]
=> [2]

// print & 字串置換

>> print poem
My toast has flown from my hand
And my toast has gone to the moon.
But when I saw it on television,
Planting our flag on Halley's comet,
More still did I want to eat it.
=> nil
>> poem['toast']='honeydew'
=> "honeydew"
>> print poem
My honeydew has flown from my hand
And my toast has gone to the moon.
But when I saw it on television,
Planting our flag on Halley's comet,
More still did I want to eat it.
=> nil

:symbol

No comments: