app/models/part.rb class Part < ActiveRecord::Base def after_create raise "no way" if self.name == "test" end end app/controllers/parts_controller.rb class PartsController < ApplicationController def test Part.create!(:name => "test") end end test/functional ...
agideo@ats1:~/apps/app_name$ ruby script/server -e production => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails ...
# app\controllers\examples_controller.rb ruby 代码   class ExamplesController < ApplicationController        def ajax_select       @items = %w{AA BB}   &n ...
1. 经常出现是的本机的 rake test 正常 但是 CC上却是错的,  花了N个小时后发现是 少了一个fixtures 原因是 本机与CC 服务器加载CC的顺序不一样. 随手写一个rake  来解决这个问题 ruby 代码   namespace :test do     task :each_file do          &n ...
在其它文章中看到 用rails ubuntu 性能最好 目前的项目 rake test 的速度让人受不了 就在自己家的电脑上小试了一把. 环境 CPU  赛扬 2.0 内存 512M 硬盘1 Ubuntu 7.04  (已经升级过了 到 7.10) Rails 1.2.2 mysql  Ver 14.12 Distrib 5.0.38, for pc-linux-gnu (i486) using readline 5.2 ruby 1.8.5 (2006-08-25) [i486-linux] 硬盘2 windows xp&n ...
注: 本片文章参考 redmine 1. rails upload_file 2.  database.yml ruby 代码 development:     adapter: sqlite3     dbfile: db/dev.db      test:     adapter: sqlite3 &nb ...
ruby 代码 assert_raise(ActiveRecord::RecordNotFound) { # 注意:这个括句一定要在一行   # xxxx   } 
open2ye
搜索本博客
我的相册
Ac44ad89-992f-34f7-973c-60b25a6ddc0c-thumb
action_auth
共 26 张
最近加入圈子
存档
最新评论