Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ruby on rails(Ê®) ¶©µ¥´¦ÖÃ

¶©µ¥´¦Öã¬Ê×ÏÈÒªÓÐÒ»¸ö¶©µ¥µÄÏêϸÁÐ±í£¨°üÀ¨ÊýÁ¿£¬¼ÛǮɶµÄ£©ºÍÒ»¸ö¶ÔÓÚ¸öÈ˵ÄһЩÐÅÏ¢µÄÒ»¸ö±í¡£Òò¶øÎÒÃÇ´´ÔìÁ½¸öÄ£ÐÍ£¬line_item(ÁбíÏî),order(Áбí)£¬Æäºó±àÕßÈç´Î
/db/migrate xxx_create_order xxx_line_item
Ruby´úÂë
Ò».class CreateOrders < ActiveRecord::Migration
¶þ.def self.up
3. create_table :orders do |t|
4. t.string :name
5. t.text :address
6. t.string :email
7. t.string :pay_type, :limit => Ê®
8. t.timestamps
9. end
Ê®.end
11.
12.def self.down
13. drop_table :orders
14.end
15.d
class CreateOrders < ActiveRecord::Migration
def self.up
create_table :orders do |t|
t.string :name
t.text :address
t.string :email
t.string :pay_type, :limit => Ê®
t.timestamps
end
end
def self.down
drop_table :orders
end
end
Ruby´úÂë
1. class CreateLineItems < ActiveRecord::Migration
¶þ.def self.up
3. create_table :line_items do |t|
4. t.integer :product_id, :null => false,:options =>
5. "CONSTRAINT fk_line_items_products REFERENCES products(id)"
6. t.integer :order_id,:null => false, :options =>
7. "CONSTRAINT fk_line_items_orders ReEFERENCES orders(id)"
8. t.integer :quantity, :null => false
9. t.decimal :total_price, :null => false,:precision => °Ë,:scale => ¶þ
10. t.timestamps
11. end
12.end
13.
14.def self.down
15. drop_table :line_items
16.end
17.d
class CreateLineItems < ActiveRecord::Migration
def self.up
create_table :line_items do |t|
t.integer :product_id, :null => false,:options =>
"CONSTRAINT fk_line_items_products REFERENCES products(id)"
t.integer :order_id,:null => false, :options =>
"CONSTRAINT fk_line_items_orders ReEFERENCES orders(id)"
t.integer :quantity, :null => false
t.decimal :total_price, :null => false,:precision => °Ë,:scale => ¶þ
t.timestamps
end
end
def self.down
drop_table :line_items
end
end
t.integer :product_id, :null => false,:options =>
"CONSTRAINT fk_line_items_products REFERENCES p


Ïà¹ØÎĵµ£º

¸øjsµÄÊý×éʵÏÖÒ»¸öÀàËÆrubyµÄµü´úÆ÷


·ÖΪÈçϼ¸½Ú:
·»ù±¾ÊµÏÖ
·ÔÚµü´úÖÐÒýÓÃÔ­À´µÄ¶ÔÏ󣬻òÕßÖ±½Ó¸Ä±äÊý×éµÄÖµ¶ø²»ÊÇ·µ»ØÒ»¸öÐÂÊý×é
·Ïòµü´ú´«ÈëÎÞÏÞ¶àµÄ²ÎÊý
·»ù±¾ÊµÏÖ
½ñÌìͻȻ·¢ÏÖjsµÄÊý×é´¦ÀíÆðÀ´ÕæÊÇÂé·³,´úÂëһЩ¾ÍÊÇÒ»´ó¶Ñ,Ïà±ÈÆðrubyµÄµü´úÆ÷À´ÕæÊÇÑ·É«²»ÉÙ,Ö÷ÒªÊÇҪдµÄ´úÂëÌ«¶àÁË,Ò²ÐíÊÇjsÓÐÌØÊâµÄ´¦ÀíÊý×éµÄ·½Ê ......

ruby ÖÐʹÓà Dom¼¼ÊõÀ´²éÕÒÒ³ÃæÔªËØ


ÓÐЩʱºò¿ÉÄÜ»á¸ù¾ÝһЩÓÐÏÞµÄÐÅÏ¢£¬À´²éÕÒÒ³ÃæµÄÔªËØ£¬ÕâÀï¾ÙÒ»¸öÀý×ÓÀûÓÃÒ³ÃæÎÄ×ÖÀ´²éÕÒËùÔڵıêÇ©£¬ÒÔÌÔ±¦µÄµÇ¼ҳÃæΪÀý£¬Ê¹ÓÃÒÔÏ´úÂë¿ÉÒÔʵÏÖ¸ù¾ÝÕË»§ÃûÀ´Ê¶±ð¶ÔÓ¦µÄ½ÚµãÃû³Æ£º 
require ‘watir’
#ie = Watir::IE.attach(:url, /member1.taobao.com/)
ie = Watir::IE.start(”http://memb ......

rubyÎļþ²Ù×÷

1¡¢ÎļþµÄ´ò¿ªÓë¹Ø±Õ
    ``r'' Read-only, starts at beginning of file (default mode).
    ``r+'' Read-write, starts at beginning of file.
    ``w'' Write-only, truncates existing file to zero length or creates a new file for writing. ......

×îÏêϸµÄRuby on Rails°²×°²½Öè


±¾ÎĽéÉÜÁËRuby on RailsµÄÏêϸ°²×°²½Öè¡£ÎÄÖÐʹÓõÄRuby on Rails°æ±¾ÊÇ1.8.6-26¡£°²×°RubyÖ®ºó°²×°Rails£¬È»ºó¾Í¿ÉÒÔ´´½¨WebÓ¦Ó㬲¢ÔÚ±¾µØ²âÊÔÁË¡£
1¡¢°²×°ruby
²»ÓÃ˵ ÊÇÏÂÔØ°²×°°ü£ºhttp://rubyforge.org/frs/?group_id=167£¬×¢Òâ°æ±¾---º¦È˲»Ç³£¬ºóÃæ»á˵µ½£¬ÎÒϵÄÊÇ1.8.6-26
×°Íêºó£¬¿ÉÒÔÓÃruby -v ²âÊÔÊÇ·ñ° ......

ruby drb

client.rb
======================================================================
require 'drb'
SERVER_IP = 'druby://127.0.0.1:6666'
CLIENT_IP = 'druby://10.10.10.102:7777'
c_path = 'd:/test/'
class Client
 def initialize(path)
  Dir.chdir(path)
 end
 
 def mk ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ