Ask A Question

Notifications

You’re not receiving notifications from this thread.

Rails & Vue.js Trello Clone - Part 3 Discussion

In `draggable` tag, `v-model` should be changed to `:list` because it's immutable. So drag and drop won't be able to update it.
Reply
^
Reply

Thank you so much

Reply

my hero ^

  <draggable :list="lists" :options="{group: 'lists'}" class="row dragArea" @end="listMoved">
Reply

Thank you so much! I was wondering why drag & drop was not working properly. I mean when you drag & drop the list was moving back to its original place.

Also it says that,

options props has been deprecated in version v2.20.

So now we would use

<draggable :list="lists" group="lists" class="row dragArea" @end="listMoved">

I think.

Reply
Sorting the other way, i.e. `->{ order( position: :desc ) }` causes objects to get the wrong position on page refresh. Is there other configuration that needs to happen to make it set that properly on drag?
Reply

If I don't want to drag and drop the columns, will I just remove the draggable directive from the columns? I still want to be able to drag cards from column to column ( and update the database) as well as modify the position of cards within the lists.

Thoughts?

Reply

Hello to all. I'm getting an Internal Server Error as a response when trying to PATCH a new list position. The error seems to be regarding the 'insert_at' method in def move in my lists controller. This is what I'm getting:

app/controllers/lists_controller.rb:60:in `move'
Started PATCH "/lists/1/move" for ::1 at 2021-08-12 18:57:16 -0500
Processing by ListsController#move as JSON
Parameters: {"list"=>{"position"=>"2"}, "id"=>"1"}
Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms | Allocations: 1158)

NoMethodError (undefined method `insert_at' for nil:NilClass):

Any thoughts?

Reply

I am getting the same error, have you found a solution?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.