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
1 answer
766 views

dependent destroy with acts_as_tree and acts_as_list

Currently I upgrade rails 2 application to rails 3.2.13 wich use acts_as_tree and acts_as_list. Before, the upgrade it works well. Since, I have a problem with acts_as_tree and acts_as_list with ...
CupraR_On_Rails's user avatar
0 votes
1 answer
221 views

Trouble update has_many :through record

I am having an issue updating a has_many through record. Here is my setup: class TastingGroup < ActiveRecord::Base has_many :group_wine has_many :wines, through: :group_wine end class ...
Paul's user avatar
  • 401
0 votes
1 answer
511 views

Ordering a has_many list in view

I have a model called Person that the user selects five personality Traits for. However, the order they pick them for matters (they are choosing most descriptive to least descriptive). I know how to ...
Kansha's user avatar
  • 570
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 ...
Mateu's user avatar
  • 2,678
1 vote
2 answers
1k views

prevent default scope from being applied to acts_as_list

I use acts_as_list to generate slot numbers of books: acts_as_list :scope => :book_id, :column => :slot and have a default scope that prevents deleted (soft delete) books from getting in to ...
amit_saxena's user avatar
  • 7,588
1 vote
2 answers
3k views

Resetting position attribute when using acts_as_list gem? (Rails)

I have a simple Rails 3 app where a Goal has many Objectives. In my views, I allow the user to-reorder the Objectives for any given Goal, and I am using the acts_as_list gem to achieve some of this ...
XåpplI'-I0llwlg'I  -'s user avatar
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!
Yuval Karmi's user avatar
  • 26.5k
0 votes
1 answer
161 views

using acts_as_list and transferring floats to int value

I would like to use acts_as_list in an app that was originally written in php and is being moved to rails. We used a 'position' value that was a float such that if a user wanted to put something ...
timpone's user avatar
  • 19.7k
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 ...
Uko's user avatar
  • 13.3k
1 vote
1 answer
559 views

Can I use acts_as_list to create multiple lists within one column?

I'm trying to add acts_as_list to an existing playlists table in my database, which stores any playlists that my users might have created. The goal is to allow users to sort their own playlists. This ...
James Chevalier's user avatar
0 votes
1 answer
284 views

content_tag_for not passing the right params

i'm trying to make a table that is sortable via drag+drop using jquery UI and acts_as_list. %tbody#lineup{"data-update-url" => sort_lineups_url} - @pieces.each_with_index do |piece, index| = ...
Matthew Berman's user avatar
1 vote
3 answers
2k views

Rails 3.1 - Drag Drop Re-order without acts_as_list?

I want to allow a drag and drop reorder facility within my app. I'm aware I can do this with acts_as_list, and have followed the Rails Recipe on this. However, due to the way my app is built, the item ...
Raoot's user avatar
  • 1,771
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 ...
ruevaughn's user avatar
  • 1,319
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 ...
ruevaughn's user avatar
  • 1,319
0 votes
1 answer
254 views

Using something other than ID in routes

I have two models, Book and Chapter. I would like chapters to be accessed by their order in the book rather that their id's /Books/the-chapter-title/chapters/1 Would it be recommended to do this ...
Joseph Le Brech's user avatar

15 30 50 per page