Questions tagged [acts-as-list]
ActsAsList is a Rails plugin that provides list abilities to an ActiveRecord model
acts-as-list
74
questions
0
votes
2
answers
100
views
Is there a way to use acts_as_list with a single parent but many different children?
I've stumbled upon this Rails - acts_as_list with multiple Models. I'm having a hard time understanding how to fit the solution into my current use case.
In my app, I have a section. The section can ...
1
vote
1
answer
174
views
Is there a way to scope acts_as_list based on column in another table?
TLDR: Is there a way to scope acts_as_list into another table as such
class SprintTodo < ApplicationRecord
belongs_to :sprint
belongs_to :todo
acts_as_list scope: [:sprint, :todo.status]
end
...
0
votes
1
answer
573
views
Error with Rails Sortable - Cannot read properties of undefined (reading 'dataset')
I followed this tutorial to implement drag and drop. https://www.driftingruby.com/episodes/drag-and-drop-with-hotwire
I am getting an error on drop that says Uncaught (in promise) TypeError: Cannot ...
0
votes
1
answer
509
views
Uncaught TypeError: $(...).sortable is not a function in Rails 6
Strugle alot but couldn't solve this problem. It been nightmare for me. I am using rails 6. and jquery ui "jquery-ui": "^1.13.0". I have added gem gem 'acts_as_list' and added ...
1
vote
2
answers
403
views
How to add position column to acts_as_list on existing database records in Rails migration?
I have seen How to change a nullable column to not nullable in a Rails migration? for the problem of adding a non-nullable column to an existing database table with existing records. As such, I am ...
1
vote
1
answer
192
views
Having trouble extending ActiveStorage::Attachment with acts_as_list
Can someone offer best practices for adding acts_as_list to active storage attachments? The gem requires "acts_as_list" added to the model in question. I am hesitant to edit the ...
1
vote
1
answer
243
views
Ruby on Rails - Does ActsAsList have known problem when working with nested_attributes?
I am having a problem when updating acts_as_list positions with nested_attributes, I have worked my way down and noticed the issue is still happening on the model level (as shown below).
The problem ...
0
votes
2
answers
1k
views
How to get the right position with Sortable.js, acts_as_list and Stimulus for nested_attributes
I'm trying to implement the "Drag and Drop Sortable Lists" (https://gorails.com/episodes/rails-drag-and-drop-sortable) with nested_attributes.
Unfortunately, I'm getting the wrong :position. ...
0
votes
1
answer
86
views
Rails Access Geocoder::Calculations
Hi All I have a little app that takes an address on the stop model and geo codes it via geocoder gem
class Stop < ApplicationRecord
belongs_to :trip
acts_as_list scope: :trip
after_validation ...
0
votes
2
answers
1k
views
How to handle drag and drop between multiple lists using SortablejS and acts_as_list gem?
I've been searching for a day and a half for a solution.
I've got several tables (Categories) that allow the user to drag and drop each row (Item) to reorder the position of each item on that table (...
1
vote
1
answer
336
views
acts_as_list on has_many :through and sortablejs
I have a fairly large question that I've been unable to resolve after a full day of reading articles, documentation and other Stack questions. At this point it's just messing with my mind!
I have an ...
0
votes
1
answer
820
views
acts_as_list puts record at wrong position with array scope
I have a model with following setup for acts_as_list gem:
acts_as_list scope: [parent_id: nil], add_new_at: :top, top_of_list: 0
I expect having next array of records:
[Record id: 1, parent_id: nil, ...
2
votes
1
answer
4k
views
Rails gem acts_as_list: How to handle reordering of list items when a list item is destroyed?
I'm using acts_as_list v0.9.17 this way:
class ListItem < ActiveRecord::Base
acts_as_list scope: [:column1_id, :column2_id], :add_new_at => :bottom
end
When a new (scoped) @list_item is ...
0
votes
1
answer
689
views
Rails gem acts_as_list, scoping the position to the user
I am using Rails 4 and the ActsAsList gem to give our Project model a position. Projects can be owned my one user, and collaborated on with many users. When a user re-orders their projects, it affects ...
0
votes
1
answer
238
views
ordering a many_to_many relationship in rails
I would like to implement a drag and drop of a list of items in a playlist. Playlist contents are of different activerecord types. I need to store the position and persist it in the database and ...