当我尝试为我的一个网格列实现排序范围时,它总是会抛出一个错误,如NoMethodError (undefined method
to_sym' for #)`
我的代码是
{
:name => :id,
:text => "Title",
:sorting_scope => lambda {|r| r.order("id desc") }
}
当我尝试为我的一个网格列实现排序范围时,它总是会抛出一个错误,如NoMethodError (undefined method
to_sym' for #)`
我的代码是
{
:name => :id,
:text => "Title",
:sorting_scope => lambda {|r| r.order("id desc") }
}
目前sorting_scope
对于列只能直接接受模型上定义的范围名称,请参见文档中的示例:https://github.com/netzke/netzke-basepack/blob/master/lib/netzke/basepack/grid。 rb#L150