itmammoth / rails_sortable

Easy drag & drop sorting with persisting the arranged order for rails
MIT License
143 stars 37 forks source link

Use rails_sortable for multiple classes #19

Closed varg90 closed 6 years ago

varg90 commented 6 years ago

Hi there! Is it possible to use this gem if I need to sort items that have different class / stored in different tables in the db? Both have sort attribute. For example: <% (first_items + second_items).each_with_sortable_id do |item, sortable_id| %> The problem is that it stores the same sort value in the db for each of the models independently

Thanks

itmammoth commented 6 years ago

Unfortunately, rails_sortable now does not support multiple classes sorting. But it seems useful in some case, so I will make it sometime.

itmammoth commented 6 years ago

Please see the example. https://github.com/itmammoth/rails_sortable/wiki/Multiple-classes