rails的一个小错误 数据库查询,找不到原因
<% form_tag :action => "search" do %>
<%= text_field_tag 'account[star_time]', "#{Time.now.strftime("%Y-%m-%d")}" %>
<%= text_field_tag 'account[end_time]' %>
<%= submit_tag '查寻' %>
<% end %>
以上是视图
def search
@accounts = Account.paginate :page => params[:page], :per_page => 15, :conditions => ["created_at between ? and ? ", params[:account][:star_time].to_s,params[:account][:end_time].to_s], :order => "created_at desc"
redirect_to :action => "index"
end
以上是控制器
错误……
Parameters: {"commit"=>"鏌ュ", "account"=>{"star_time"=>"2010-01-19 00:00:00.0", "end_time"=>"2010-01-21 00:00:00.0"}, "authenticity_token"=>"Vm6+5o0ogGsXgRgZiicQmXW+Uvq3vwYDcljWaxaC5dU=", "picking"=>"鍦ㄧ嚎"}
[4;36;1mAccount Load (0.0ms)[0m [0;1mSELECT * FROM `accounts` WHERE (created_at between '2010-01-19 00:00:00.0' and '2010-01-21 00:00:00.0' ) ORDER BY created_at desc LIMIT 0, 15[0m
Redirected to http://localhost:3000/admin/admin_accounts
Completed in 16ms (DB: 0) | 302 Found [http://localhost/admin/admin_accounts/search]
[2010-01-23 10:31:24] 主要这句呗:ERROR TypeError: can't convert Array into String
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/output_safety.rb:34:in `concat_without_safety'
[解决办法]
是么?接分