search for: move_to_bottom

Displaying 11 results from an estimated 11 matches for "move_to_bottom".

2007 May 22
3
can I use acts_as_list with a has_many :through association
I''d like to be able to use a has_many :through association and treat the associations as a list but I''m getting this error when I try an use an acts_as_list method: NoMethodError: undefined method `move_to_bottom'' I''m using edge rails r6786. Here are my domain rules: Activities are things students can do. Units consists of a sequenced list of Activities. Activities can be used in many Units. Here are the associations for these rules: class Activity < ActiveRecord::Base...
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
...reated_at: *id004 errors: !ruby/object:ActiveRecord::Errors base: *id005 errors: {} new_record: false new_record_before_save: true errors: !ruby/object:ActiveRecord::Errors base: *id006 errors: {} new_record: false new_record_before_save: true => nil >> c.elements.first.move_to_bottom NoMethodError: undefined method `move_to_bottom'' for #<Page:0x3318ba4> from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/base.rb:1860:in `method_missing'' from (irb):8 from :0 I would be very pleased if you could help me .....
2006 Apr 01
3
acts_as_list with scope : position update problem?
...eRecord::Base belongs_to :family, :order => ''position'' acts_as_list :scope => ''family_id'' validates_uniqueness_of :position, :scope => ''family_id'' end Now, all this works fine, I can execute commands like person.move_higher, person.move_to_bottom, etc. So the class behaves as expected with acts_as_list, updating the position column all by itself : >> @person = Person.find_by_id(2) => #<Person:0x239cd64 @attributes={"family_id"=>"1", "name"=>"Brian", "id"=>"2&quot...
2007 Feb 19
0
Invalid SQL generated with PostgreSQL 8.2.3
...#<Slideshow:0x7f2d7588 @attributes={"name"=>"Interesting pictures", "id"=>"1", "created_at"=>"2007-02-17 19:41:30.703"}> >> show.slides.first.photo.filename => "balboa_park.jpg" >> show.slides.first.move_to_bottom ActiveRecord::StatementInvalid: PGError: ERROR: argument of AND must be type boolean, not type integer : UPDATE slides SET position = (position - 1) WHERE (slideshow_id AND position > 1) from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/ active_record/connection_adapters/abstract...
2010 Dec 23
6
Difference between rake test:units and individually running ruby -I test test/unit/something_test.rb ?
Here''s my issue: running ruby -I test test/unit/something_test.rb for each of my unit tests works perfectly. However, running rake test:units brings errors in all of them - some object becomes nil for some reason. Why might this be happening? Specifics: the object that is successfully not nil when I run the unit tests one-by-one but becomes nil when I do rake test:units is defined like
2005 Jul 07
2
0.13 ajax sortable lists and acts_as_list
...dered list of ids back to the server after every change, but acts_as_list is designed to deal with diff-like changes, rather than reordering the whole list from scratch. My quick and dirty solution is to @thing_ids = params[:things] @thing_ids.each do |thing_id| Thing.find(thing_id).move_to_bottom end But that''s rather inefficient, and quite slow when you''re ordering large lists. Any better ideas? Tyler
2006 Jan 01
7
[ ANN ] Hieraki2
Happy new year! Hieraki 2.0.0 is released. You can download Hieraki2 from rubyforge.org as tgz or zip (http://rubyforge.org/projects/hieraki). Hieraki2 has a new wiki engine that ships with more than a dozen new features: * everything-is-a-wiki-page (TM) * all pages are under version control * access control list * stay in full control of the tree structure by cut and pasting
2006 Mar 23
1
handle multiple lists: move an item from one list to another
How do I manage multiple lists? This is what I need. Sometimes an item needs to be moved from one list to another. class Item < ActiveRecord::Base belongs_to :group acts_as_list :scope => :group end class Group < ActiveRecord::Base has_many :items, :order => "position" end Now, sometimes, I may need to change an item from one group to another. But when I do that,
2005 Jul 12
2
save order from drag and drop
only just found the script.aculo.us site. brilliant. much respect. wondered if anyone can point me in the right direction on this drag and drop list re-ordering type thing, i''ve read through what I can but to be honest it''s gone right over my head! How do I get the new order that has been established via dragging list elements around and store them in a database. I figured an
2007 Jul 12
1
acts as list -- adding or moving new item to new location
right now i''m adding an item to my ''list'' but i''m unsure how to move it to a certain spot in the list. specifically i want to put it at the bottom of the list. i assumed that if i did something like parent.children << new_child then the ''position'' field in the child table would be given some sensible default by rails but instead
2006 Apr 30
4
acts_as_ordered_tree
I need an ordered (sortable tree) and I just was thinking if somehting like this is possible: class Item< ActiveRecord::Base acts_as_tree :order => "position" acts_as_list :scope => ''parent_id = #{self.id}'' end For my understanding mixing of two acts_as should be p?ssible, at least in this case, right? Unfortunatly the :scope is not working, I am not