Ruby on rails 将在RubyonRails3.2上使用多个数据库进行分页
我的rails应用程序连接到一个mysql数据库,但在一个单一型号的客户中,我使用不同的sql server数据库。我的应用程序工作正常,我可以使用Customer.all获取所有客户,但当我尝试添加分页时,我会出现以下错误:Ruby on rails 将在RubyonRails3.2上使用多个数据库进行分页,ruby-on-rails,ruby,database,ruby-on-rails-3,will-paginate,Ruby On Rails,Ruby,Database,Ruby On Rails 3,Will Paginate,我的rails应用程序连接到一个mysql数据库,但在一个单一型号的客户中,我使用不同的sql server数据库。我的应用程序工作正常,我可以使用Customer.all获取所有客户,但当我尝试添加分页时,我会出现以下错误: Mysql2::Error: Table 'mysql_database.Customers' doesn't exist: SHOW CREATE TABLE `Customers` 出于某种原因,will_paginate正在我的主数据库mysql而不是sql se
Mysql2::Error: Table 'mysql_database.Customers' doesn't exist: SHOW CREATE TABLE `Customers`
出于某种原因,will_paginate正在我的主数据库mysql而不是sql server db中搜索表
在我的CustomerController中,我有:
def索引
@customers=Customer.paginate:page=>params[:page],:order=>'name1,name2 asc',
:每页=>20
回应待办事项|格式|
format.html index.html.erb
format.json{render:json=>@customers}
终止
终止
这是我的SQL Server模型,它连接到mssql_db
类Customer