rails

在:
class QaUserController < ApplicationController
before_filter :authorize,:except=>:user_login
end

在:
def authorize
puts "---------------------1-----------------"
puts session[:user_id]
puts "---------------------1-----------------"
unless QaUser.find_by_id(session[:user_id])
@sesok =0
puts "Please log in"
end

end

mongrel开启出现:
=> Ctrl-C to shutdown server
---------------------1-----------------
nil
---------------------1-----------------
[4;36;1mSQL (0.0ms)[0m [0;1mSET NAMES 'utf8'[0m
[4;35;1mSQL (0.0ms)[0m [0mSET SQL_AUTO_IS_NULL=0[0m


Processing QaUserController#qa_index (for 127.0.0.1 at 2010-06-22 11:43:57) [GET]
[4;36;1mSQL (0.0ms)[0m [0;1mBEGIN[0m
[4;35;1mQaUser Load (15.0ms)[0m [0mSELECT * FROM `qa_users` WHERE (id = NULL) LIMIT 1[0m
[4;36;1mSQL (0.0ms)[0m [0;1mCOMMIT[0m
Rendering template within layouts/application
Rendering qa_user/qa_index
Completed in 1938ms (View: 313, DB: 31) | 200 OK [http://localhost/qa_user/qa_index]
Tue Jun 22 11:43:59 +0800 2010: Read error: #<ArgumentError: wrong number of arguments (0 for 1)>
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2155:in `hash'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2155:in `[]'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2155:in `subclasses'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2156:in `subclasses'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2036:in `inject'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2156:in `each'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2156:in `inject'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2156:in `subclasses'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:406:in `reset_subclasses'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:63:in `cleanup_application'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:17:in `close'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:82:in `process'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in `process_client'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `each'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `process_client'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `initialize'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `new'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `initialize'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `new'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `run'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
D:/Ruby/ruby-1.8.6-p111/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
D:/Ruby/ruby-1.8.6-p111/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
qa_index]

奇怪不知道什么原因?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值