You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.1 Start a new project from the starter repo
1.2 run bin/configure and name application to "Sortable Demo"
1.3. run bin/setup
Step 2: Add a sortable super scaffolded resource
2.1 Create a model: rails g model Book name:string team:references sort_order:integer
2.2 Make sure Team has_many :books
2.3 Super Scaffold a Books Resource with --sortable flag: bin/super-scaffold crud Book Team name:string --sortable
Step 3: Add books, re-order, check console, refresh the page
3.1 Run bin/dev, create an account and from the dashboard, add books
3.2 When a few books are added, attempt a re-order by dragging books into a different order
3.3 Check the console, you should see an 422 error logged into the console
3.4 Refresh the page. The order of books should not be the same as before the refresh
To fix:
Make sure that the $.post() request includes the csrf-token meta tag content. This should be in by default across the whole project, but for some reason @rails/ujs doesn't pick up jQuery's inclusion into the project.
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
Step 1: Prepare a demo project
1.1 Start a new project from the starter repo
1.2 run
bin/configure
and name application to "Sortable Demo"1.3. run
bin/setup
Step 2: Add a sortable super scaffolded resource
2.1 Create a model:
rails g model Book name:string team:references sort_order:integer
2.2 Make sure Team
has_many :books
2.3 Super Scaffold a Books Resource with
--sortable
flag:bin/super-scaffold crud Book Team name:string --sortable
Step 3: Add books, re-order, check console, refresh the page
3.1 Run
bin/dev
, create an account and from the dashboard, add books3.2 When a few books are added, attempt a re-order by dragging books into a different order
3.3 Check the console, you should see an 422 error logged into the console
3.4 Refresh the page. The order of books should not be the same as before the refresh
To fix:
$.post()
request includes thecsrf-token
meta tag content. This should be in by default across the whole project, but for some reason@rails/ujs
doesn't pick up jQuery's inclusion into the project.The text was updated successfully, but these errors were encountered: