Questions tagged [acts-as-list]
ActsAsList is a Rails plugin that provides list abilities to an ActiveRecord model
acts-as-list
24
questions with no upvoted or accepted answers
4
votes
0
answers
688
views
Using acts_as_list and nested_form together in Rails 3.1.rc4 app
I originally posted this up as an issue on nested_form but not had any insight. The detail is here: https://github.com/ryanb/nested_form/issues/66
Recap:
I have a slightly unusual requirement that ...
2
votes
0
answers
199
views
'last' method not returning last item in array in RSpec test - Rails4 Ruby 2.1.2
Was working on an RSpec test that copies @protocol to @dest and saw this:
[26] pry(#<RSpec::ExampleGroups::ProtocolsController::ProtocolCopy>)> @protocol.step_items.count
=> 3
[27] pry(#&...
2
votes
0
answers
257
views
How to update acts_as_list using multiple columns
I have a Rails 3.2 app that uses acts_as_list on two columns in the same model:
This is in the costproject model:
acts_as_list :column => :division_priority, :scope => :client
acts_as_list :...
1
vote
1
answer
194
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
246
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 ...
1
vote
2
answers
265
views
acts_as_list upper_limit on position
I am using acts_as_list on my model.I have a position column on that model for which I don't wan't the model object to be saved to the database if the position is more than my upper-limit.(I tried ...
1
vote
0
answers
153
views
Sort collection after associated resource's acts_as_tree/acts_as_list order
I have a SuccessCriterion model that implements both acts_as_tree and acts_as_list so it can be arranged as sorted tree hierarchy. Every success criterion can has many Boilerplate objects.
class ...
1
vote
0
answers
104
views
rails acts_as_list specific to user and date
I'd like to use acts_as_list in my stock market application but the ordering position should be specific to the user, the ticker and date.
acts_as_list scope: [:user_id, :ticker, :market_date]
So, ...
1
vote
0
answers
55
views
acts_as_list how to add a second list based on related table column
In a Rails 3.2 app I'm trying to add an acts_as_list to the model costproject.
Client model:
belongs_to :department
Costproject model:
belongs_to :client
Both department_priority is in ...
1
vote
0
answers
73
views
acts_as_list wipes out parent model's virtual attribute when calling destroy on child model
I have a Parent model which has_many children and also a virtual attribute:
attr_accessor :new_assocation_model
has_many :children, -> { order("position ASC") }, autosave: true, inverse_of: :...
1
vote
0
answers
188
views
Restrict scope in acts_as_list
class TodoList < ActiveRecord::Base
has_many :todo_items, -> { order("position ASC") }
end
class TodoItem < ActiveRecord::Base
belongs_to :todo_list
acts_as_list scope: :todo_list
end
...
0
votes
1
answer
580
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
827
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, ...
0
votes
1
answer
245
views
How to use remove_from_list method of ActiveRecord with scope as public in the model?
Lets say my model is C . Obj - @c
C has acts_as_list gem defined as
acts_as_list scope: '...'
and scope as :
scope :public -> {where (some_condition)}
When writing rspec for @c.remove_from_list , ...
0
votes
1
answer
135
views
Acts as list with a subgroup
I'm using the popular gem, acts_as_list and I am having issue with getting the scope to work. Basically there're three models, a group, a subgroup, and a thing. A group has many subgroups and a ...