문제

I'm using sortable_table plugin for sorting html table in rails app.

If we want to order by multiple columns, can sortable_table plugin do it ? Example:

    select distinct brands.title as brands, models.title as model 
    from brands, models
    where 
    brands.id = models.brand_id
    order by brands.title desc, models.title desc
도움이 되었습니까?

해결책

Oh.. I get it!

Just put sortable_attributes on controller as array.

For example:

sortable_attributes :brand_model => ["brands.title", "models.title"]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top