-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Yarn/NPM package #45
Comments
How do I install? |
I think it's time to make independence from jQuery... |
I'm also trying to install into a rails6+webpacker project, and failing miserably. JavaScript is not my strong point (and webpacker seems to have made it 10x as confusing so far) so I have no idea whether I'm failing because I'm missing something, or because its not actually possible currently... clues welcome! 🙂 |
You do this in ES6 by custom setting up this package with custom configuration on change. Then you need to do post request to '/sortable/reorder', and give the following params: // pass array of sortable_id's from table in new order
{ rails_sortable: [ sortable_id, ... ] } |
To add a bit more context to sergio-rivas's answer from above, this is how I accomplished using this Gem with Rails 6 and webpacker. javascript
html.erb<ul class="sortable">
<li class="list-group-item" data-sortable-id="<%= item.sortable_id %>">
... Using the I did have troubles with the CSRF tokens and ended up disabling enforcement for the reorder endpoint with an initializer as described here. |
Case: Rails 6 with webpack
The text was updated successfully, but these errors were encountered: