标签: ruby-on-rails ruby ruby-on-rails-4
我有模特Stat:
class Stat < ActiveRecord::Base establish_connection( :adapter => "mysql2", :database => @db ) end
我想使用params [:id]
示例,如果网址
/stat/?id=db01
模型统计:
@db = "db01"