bolshakov / activeadmin_sortable_table

Drag and drop sort interface for ActiveAdmin tables
MIT License
17 stars 14 forks source link

Gem assumes namespace #13

Open davidwparker opened 6 years ago

davidwparker commented 6 years ago

The namespace should be taken from the Registered Page:

ActiveAdmin.register Thing, namespace: :something do

It currently assumes admin

https://github.com/bolshakov/activeadmin_sortable_table/blob/master/lib/active_admin/sortable_table/handle_column.rb#L22-L25

bolshakov commented 6 years ago

@davidwparker good catch. Would you mind fixing this?

davidwparker commented 6 years ago

I'll see if I can squeeze out some time at work, cheers!

etozzato commented 5 years ago

+1

davidwparker commented 5 years ago

@bolshakov - our workaround, since we didn't end up changing anything.

        column '', class: 'activeadmin_sortable_table' do |resource|
          span('☰'.html_safe,
            class: 'handle',
            'data-sort-url' => url_for([:sort, :admin2, resource]), #<< :admin2 instead of :admin
            'data-position' => resource.send(resource.position_column),
            title: 'Drag to reorder'
          )
        end