Skip to main content

Questions tagged [acts-as-list]

ActsAsList is a Rails plugin that provides list abilities to an ActiveRecord model

acts-as-list
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 ...
Dennis Martinez's user avatar
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 ...
Sawaid's user avatar
  • 77
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 ...
spacerobot's user avatar
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 ...
Sanju Basnet's user avatar
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 ...
Alien's user avatar
  • 1,102
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 ...
Scott Tallarida's user avatar
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 ...
k.jobbins's user avatar
  • 113
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. ...
Mirha Masala's user avatar
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 ...
Jeremy Bray's user avatar
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 (...
J. Jackson's user avatar
  • 3,766
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 ...
J. Jackson's user avatar
  • 3,766
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, ...
mitsuka s's user avatar
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 ...
Backo's user avatar
  • 18.7k
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 ...
Emily Kingan's user avatar
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 ...
Ayrad's user avatar
  • 4,006

15 30 50 per page
1
2 3 4 5