`
kevinye
  • 浏览: 37554 次
文章分类
社区版块
存档分类
最新评论
文章列表
你会发现 ROR有多么的神奇记住下面的几个文件,用javascript_include_tag "prototype"来使用 prototype.js  用javascript_include_tag "effects" 来使用 effects.js
  create table products (id int not null auto_increment,title varchar(100) not null,description text not null,image_url varchar(200) not null,price decimal(10,2) not null,date_available datetime not null,primary key (id));在config\database.yml文件中,你可以找到数据库连接的参数。方便而安全。以上的SQL语名创建了表products,在ROR中,以下的语句就会产 ...
>rails demo >cd demo>ruby script/server         http://localhost:3000 further more,create  a controllerdemo> ruby script/generate controller SayYou’ll find it in the file    app/controllers/say_controller.rb  class SayController < ApplicationControllerend then,create an action and name ...
Rails is a Model-View-Controller framework.  Rails accepts incomingrequests from a browser, decodes the request to find a controller, andcalls an action method in that controller. The controller then invokes aparticular view to display the results back to the user. The good news isthat Rails takes ca ...
The value returned by a Rubymethod is the value of the last expression evaluated, so we can get rid ofthe temporary variable and the return statement altogether.Prefixing a method name with self. (as we do on line 5) makes it a classmethod: it can be called on the class generally.Instance variables a ...
A symbol looks like a variable symbolsname, but it’s prefixed with a colon. Examples of symbols include :action,:line_items, and :id. You can think of symbols as string literals that aremagically made into constants. Alternatively, you can consider the colonto mean “thing named” so :id is “the thing ...
from http://rubycn.ce-lab.net/面向对象的脚本语言RubyRuby是何方神圣?Ruby是一种功能强大的面向对象的脚本语言,她可以使您方便快捷地进行面向对象编程.Ruby使文本处理和系统管理变得简单,与Perl非常相似.一句话:简单明了,扩展性强,移植性好.Ruby的几大亮点: 语法简单 垃圾回收 可移植性 动态载入 完全免费 正则表达式 走向世界的Ruby松本行弘"Matz"(Matsumoto Yukihiro)是Ruby语言的发明人,他从1993年起便开始着手Ruby的研发工作。他一直想发明一种语言 ...
Global site tag (gtag.js) - Google Analytics