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 subgroup has many things. Is it possible to make the gem work without having to make the thing know what group it is on if these need to be ordered within the context of the group and not the subgroup? Basically I don't want to add a group_id to the things table as the things table can already calculate what group it belongs to based on it's subgroup_id
Acts as list with a subgroup
218 Views Asked by Charlie Massry At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- Rails HABTM: Select everything a that a record 'has'
- Best way to make an HABTM association via console
- dynamically create an ical / ics file from a rails model
- Ruby destroy is not working? Or objects still present?
- NoMethodError: undefined method `update_average_rating' for nil:NilClass
- Select results where joined table contains records with an attribute, but without another
- Showing posts only created when boolean was true
- Ruby on rails and HAML - Print a hash with background color
- How can I monitor an endpoint's status with Ruby?
- How to create dynamic pages without form_for helper in Rails?
- Rails 4.2 jQuery loads only after refresh
- "Access Denied" - User's Permissions to S3 Bucket
- ActiveRecord, Rails 4: has_many :through with scoped conditions failure
- Rails - formatting a list of options
- Rails - Ajax do not work properly on production server
Related Questions in ACTS-AS-LIST
- Set Position Value from Index for nested model attributes
- acts_as_list "NoMethodError (undefined method `position_was' for xxx)"
- Acts as list with a subgroup
- Using something other than ID in routes
- Rails 4: acts_as_list with complex scope
- Rails 3.1 - Drag Drop Re-order without acts_as_list?
- Should acts_as_list automatically reorder items when a resource is updated with update_attributes?
- Using acts_as_list on multiple columns
- Ruby on Rails - Does ActsAsList have known problem when working with nested_attributes?
- Having trouble extending ActiveStorage::Attachment with acts_as_list
- ordering a many_to_many relationship in rails
- using acts_as_list and transferring floats to int value
- Stack level too deep when calling remove_from_list from acts_as_list gem
- Rails Access Geocoder::Calculations
- Restrict scope in acts_as_list
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Have you tried a
has_many through:for the grandparent relationship from the grandchild, then using this as the scope?You could also try adding a
default_scopethat selects the grandparent_id as an extra field in the results, then using that field in your scope?