rails on ruby exmaples depot
1.install ruby
download from http://www.ruby-lang.org/en/news/2009/12/07/ruby-1-9-1-p376-is-released/
2.install rails
ruby gem install rails --include-dependencies
3.install mysql
download from http://sourceforge.net
ruby gem install mysql
1-3 can be down by download InstantRails from http://rubyforge.org/frs/?group_id=904 <InstantRails2.0.2>
4. create depot application:
ruby> rails --database=mysql depot
mysqladmin -u root create depot_development
ruby> rake db:migrate
ruby> ruby script/generate scaffold product title:string description:text image_url:string
ruby> ruby script/server webrick
IE: http://localhost:3000/product like below:
Listing products
TitleDescriptionImage url
NO1product
no1 product input by myself
Show
Edit
Destroy
New product
5.then can do modify the depot application........
Notice:
1-3 mybe failed, it result is Rails2.3.4 hte lastest version.
InstantRails 2.0.2 is more better for most pepole
Ïà¹ØÎĵµ£º
ÉÏһƪÎÄÕÂ
˵ÁËRubyµÄ°²×°ºÍÔËÐУ¬Ò²¼òµ¥µÄ˵ÁËÏÂÀàºÍ¶ÔÏó¡£ÕâÀïÖ÷Ҫ̸̸±äÁ¿µÄÎÊÌâ¡£
ÏÈ˵³£Á¿
¡£Èç¹û±äÁ¿ÃûÒÔ´óд×Öĸ¿ªÍ·£¬¾Í±»ÊÓΪ³£Á¿£¬µ«Í¨³£ÊÇËùÓÐ×Öĸ¶¼´óд¡£µ«ºÍÆäËûÓïÑÔ²»Í¬£¬ÔÚRubyÖУ¬ÄãÈÔÈ»¿ÉÒԸı䳣Á¿µÄÖµ£¬µ±È»½âÊÍÆ÷»áÅ׳öÒ»¸ö¾¯¸æ£º
#! /usr/bin/ruby
CONSTANT = 1
print "#{CONSTANT}\n&qu ......
×î½üÔÚ¿´John E.Hopcroft,Rajeev Motwani,Jeffrey D.Ullman Èý¾ÞͷдµÄIntroduction to Automata Theory,Language,and Computation£¬Ïëдһ¸öTuring »úÑéÖ¤Ò»ÏÂ×Ô¼ºÐ´µÄ״̬תÒƺ¯Êý¶Ô²»¶Ô¡£ÀÁµÃºÜ£¬ÍøÉÏËÑÁ˼¸¸ö²»´íµÄ¡£µ«Ruby Quiz ÉϵÄÕâ¸ö×î¼òµ¥¡£
162 Turing »ú
ÎÊÌâÃèÊö
Quiz
description by James Edward Gray ......
¶©µ¥´¦Öã¬Ê×ÏÈÒªÓÐÒ»¸ö¶©µ¥µÄÏêϸÁÐ±í£¨°üÀ¨ÊýÁ¿£¬¼ÛǮɶµÄ£©ºÍÒ»¸ö¶ÔÓÚ¸öÈ˵ÄһЩÐÅÏ¢µÄÒ»¸ö±í¡£Òò¶øÎÒÃÇ´´ÔìÁ½¸öÄ£ÐÍ£¬line_item(ÁбíÏî),order(Áбí)£¬Æäºó±àÕßÈç´Î
/db/migrate xxx_create_order xxx_line_item
Ruby´úÂë
Ò».class CreateOrders < ActiveRecord::Migration
¶þ.def self.up
3. create_tabl ......
¹«Ë¾ÀïÔ½À´Ô½¶àµÄ½Ó¿ÚÒÔICE·½Ê½ÌṩÁË£¬ÒÔǰû½Ó´¥¹ý£¬ËùÒÔÎÒÕâÁ½ÌìÒ²³éÁ˵ãʱ¼äÑо¿ÁËÏÂICE£¬²Î¿¼ÁËÍøÉϺܶàÌû×Ó£¬²ÅÖÕÓÚÅÜͨµÚÒ»¸ö¼òµ¥µÄICE
½ÓÏÂÀ´ÌùÉÏÎÒËùÓл·¾³µÄ´î½¨¹ý³ÌÒÔ¼°´úÂ룬ºÍ´ó¼Ò·ÖÏíÏÂICEËù´øÀ´µÄ¿ìÀÖ
ICEÊÇʲôÎҾͲ»¶à˵ÁË
1¡¢ Ò»¿î¸ßÐÔÄܵÄÖмä¼þ£¬»ùÓÚICE¿ÉÒÔʵÏÖµçÐż¶µÄ½ ......