All Questions
Tagged with acts-as-list ruby-on-rails-4
7
questions
0
votes
1
answer
693
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
881
views
Using acts_as_list, set scope to string column
Using acts_as_list, I'm trying to set the scope to the where column.
acts_as_list scope: :where
where is the name of a string column in the model.
But when I'm getting this error:
undefined ...
0
votes
1
answer
578
views
multi position column with acts_as_list
How to use multi position columns with acts_as_list gem ?
for sample :
rails g migration AddPositionToTodoList position:integer position2:integer position3:integer
controller:
todo_list = TodoList....
0
votes
1
answer
61
views
Maintain order of saved attributes list for model
I have two models with a has_many to has_many relationship through a join table.
class Article < ActiveRecord::Base
has_many :authorings, -> { order(:position) }, :dependent => :destroy
...
1
vote
4
answers
1k
views
Set Position Value from Index for nested model attributes
How can I set a position field in the attributes for a nested model so that my has_many relationship remembers it's sort order?
I want to set the position from the index so that it reflects the order ...
0
votes
1
answer
45
views
AR equivalent to these SQL statements or how otherwise to use them in Rails?
I wanted to use the gem acts_as_list to reorder lists.
But it doesn't seem to handle more restricted queries than association-based (I want to order lists based both on an association AND objects ...
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
...