2
我需要在我的wicegrid中显示一个虚拟属性:状态,但我总是得到这样的错误:状态不在数据库中......当然不是它的虚拟!带虚拟类属性的Rails wice_grid
有没有办法让一个包含虚拟属性的列?如果是的话,我怎么能有一个自定义的过滤器呢?
视图模型
class Shop < ActiveRecord::Base
attr_accessor :status
end
<%= grid(@grid, upper_pagination_panel: false) do |g|
g.column name: "Status", attribute: "status"
<% end %>