在i18n rails应用程序中本地化图像(按钮和其他内容)的最佳方法是什么?
我有一个简单的多对多ER描述如下:
型号order.rb:
class Order < ActiveRecord::Base
has_many :cronologies
has_many :statuses, :through => :cronologies
end
Run Code Online (Sandbox Code Playgroud)
型号cronology.rb:
class Cronology < ActiveRecord::Base
belongs_to :order
belongs_to :status
validates_uniqueness_of :order_id, :scope => :status_id
end
Run Code Online (Sandbox Code Playgroud)
型号status.rb:
class Status < ActiveRecord::Base
has_many :cronologies
has_many :orders, :through => :cronologies
end
Run Code Online (Sandbox Code Playgroud)
下面的代码让我获得分配给订单的所有状态.
@order.statuses
Run Code Online (Sandbox Code Playgroud)
...但是如何通过cronology表的"created_at"属性获取状态?