Questions tagged [acts-as-list]
ActsAsList is a Rails plugin that provides list abilities to an ActiveRecord model
acts-as-list
74
questions
11
votes
4
answers
3k
views
acts_as_list with has_and_belongs_to_many relationship
I've found an old plugin called acts_as_habtm_list - but it's for Rails 1.0.0.
Is this functionality built in acts_as_list now? I can't seem to find any information on it.
Basically, I have an ...
8
votes
1
answer
1k
views
Rails - acts_as_list with multiple Models
I've managed to use act_as_list with my Models (it was quite easy) one by one, but now i have a problem.
In my app there are 3 models: Facility, Service and Activity. I need to use acts_as_list on ...
6
votes
2
answers
2k
views
How to get Rails' acts_as_list to add new items to the beginning of a list?
I have a model integrated with acts_as_list. However, by default new items created get added to the end of the list. Is there a default way to add new items to the beginning?
Thanks!
6
votes
3
answers
3k
views
Using acts_as_list on multiple columns
I have a possibly unique case where I need a model to have two differing orders depending on the model it is joined to. Example as follows:
class Book
acts_as_list :column => :genre, :scope =&...
5
votes
3
answers
6k
views
has any one gotten acts_as_list to work on rails 3?
I installed by putting the following line in Gemfile and 'bundle install':
gem 'acts_as_list', '>= 0.1.0'
However, when I try to use it, the results are not as expected:
technician....
4
votes
1
answer
2k
views
rails: sort a has_many using :order is not working due to order by timestamp
I have a rails model let say
User with a has many relationship with Post. Post contains an attribute named position that stores the position (acts_as_list gem). The position stores the position on the ...
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 ...
3
votes
2
answers
4k
views
Should acts_as_list automatically reorder items when a resource is updated with update_attributes?
I'm using the acts_as_list plugin with rails 3.1 and whenever I add or remove a resource existing positions are ordered and updated fine. However, when updating the position of a resource with ...
3
votes
1
answer
4k
views
Rails 3.1: undefined sortable_element using acts_as_list gem - how to fix?
How do I get sortable_element from the acts_as_list gem to work nice with Rails 3.1? I think it's because jquery is used instead of prototype so I lose that helper method? Is this right? In which ...
2
votes
1
answer
428
views
Create a custom move_up route and move_down actions/route Rails
I am trying to create two little buttons with an up and down arrow, and sort my Products based on that. I have a model called Product, and am using acts_as_list to keep track of position.
Do I do ...
2
votes
1
answer
3k
views
Ordering position on Model during update
I am using acts_as_list on my Product model, and trying to make it so you can manually edit the position. Currently if I edit Product 3 from position 3 to position 1, it won't adjust the other ...
2
votes
2
answers
4k
views
How to sort deeply nested collections with ActiveRecord?
I'm building a music-managing Rails app, and my app's users will be able to make ordered playlists of albums, and each album will have an ordered list of songs.
In essence, this will look like:
...
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 ...
2
votes
1
answer
2k
views
Reordering in ActiveAdmin
sometime we need to reorder our resources and acts_as_list is really useful for this task. My question is:
What is the best way to implement reordering of some resources in ActiveAdmin framework.
I ...
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(#&...