Displaying 20 results from an estimated 100000 matches similar to: "please explain remove_from_list"
2007 Jan 25
1
acts_as_tree with acts_as_list
Hello all,
I''m having trouble using acts_as_list with acts_as_tree
to order the "children". I''ve found a few old posts on the web
that seem to indicate that this once worked.
class Whatever < ActiveRecord::Base
acts_as_tree :order => :position
acts_as_list :scope => :parent_id
Although the ''position'' field is being populated,
it appears
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my
problem:
4 models : Collection, Page, Fragment, Belonging (which is the join
table):
1 class Collection <
ActiveRecord::Base
2 has_many_polymorphs :elements,
3 :through => :belongings,
4 :from => [:pages, :fragments, :collections],
5 :as => :collector,
6 :parent_order =>
2006 Sep 03
7
using polymorphic associations with acts_as_list
This is what I have
class Photo < ActiveRecord::Base
belongs_to :image, :polymorphic => true
acts_as_list :scope => image
end
class Place < ActiveRecord::Base
has_many :photos, :as => :image
end
class Child < ActiveRecord::Base
has_many :photos, :as => :image
end
I want to be able to reorder the images. What I need is for the
position of the photos to be set
2006 Apr 28
5
please explain web services
could someone explain some of the uses for a web service. i''m reading
about how to make them, but i''m still not quite sure what they''re good
for.
i have multiple rails apps that i would like to pass user information
back and forth to. i''m not sure if something like this could help me or
not.
thanks
--
Posted via http://www.ruby-forum.com/.
2009 Jan 04
3
undefined local variable or method `acts_as_list'
So I seem to be having an issue with trying to install acts_as_list in
rails 2.2.2?
I have downloaded the files from: http://github.com/rails/acts_as_list/tree/master
I have put the files in the vendor/plugins folder the files are as
follows:
vendor/plugins/acts_as_list/init.rb
vendor/plugins/acts_as_list/lib/active_record/acts/list.rb
vendor/plugins/acts_as_list/test/list_test.rb
2009 Feb 12
0
acts_as_list sort by multiple items
I have a Person model and I''m using acts_as_list so I can have drag/drop
positioning of people. The only thing is, I want to be able to
differentiate between male and female, ie. sort males separately from
females. It seems completely useless to have two separate models since
all the other attributes of a person are the same (name, address etc)
Does acts_as_list allow ordering by, say,
2009 Jan 05
3
Plugin not found: ["acts_as_list"]
I am trying to install acts_as_list in a rails 2.2.2 project but when I
try the following: ruby script/plugin install acts_as_list
I get: Plugin not found: ["acts_as_list"]
I had to download the acts_as_list plugin from the github because it
isn''t included in Rails 2.2.2.
The files are in my vendor/plugins/acts_as_list folder so I have:
lib/active_record/acts/list.rb
2007 Mar 28
1
acts_as_list nested scope
Here''s what I''m trying to do:
class Model < AR::Base
acts_as_list :scope => [:key_one_id, :key_two_id, :key_three_id]
end
with the idea being that there are these three references from this table
(one of them being optional) that define the list. I don''t think acts as
nested set works in this situation because I''m still just dealing with a
single list
2006 Dec 05
4
has_many with :uniq not working for me
Hi all,
I have a relationship (no really!)
class RiskMatrix < ActiveRecord::Base
has_many :severities, :order => :position, :uniq => true
end
class RiskFactor < ActiveRecord::Base
belongs_to :risk_matrix
validates_presence_of :descriptor, :example
validates_uniqueness_of :descriptor, :example, :scope=> :risk_matrix_id
end
class Severity < RiskFactor
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
2006 Apr 01
3
acts_as_list with scope : position update problem?
Hello,
I''ve tried to set up a class with acts_as_list with a scope argument
that restricts a list to records with the same foreign key.
For example :
database :
CREATE TABLE `families` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '''',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
INSERT INTO
2007 Apr 29
1
acts_as_list with :scope - how do I move items to a different list?
Hi,
I have in my simplistic app:
class Album
has_many :pics, :order => :position
end
class Pic
belongs_to :album
acts_as_list :scope => ::album
end
It all works fine when creating a new pic from the forms. But, when
trying to move a pic between albums, the album changes Ok, but no
matter what I do the position attribute stays the same and the list
navigation is broken. So far,
2006 Dec 10
0
Rails Recipes: Drag'n'Drop Sortable List with unique index?
Hi all
On page 31 of the "Pragmatic Programmer''s Rails Recipes" book there''s
the recipe "Creating a Drag-and-Drop Sortable List". I think this is
very useful, but sadly I have a unique constraint on my product_id and
position fields (because the acts_as_list scope is product_id).
When I try the recipe then Rails crashes very very badly: I have to
restart the
2008 Oct 02
2
alternative to "script/plugin install -x" that works with git
I miss the svn:externals feature when installing plugins that are
managed under git. the -x switch used to do this.
I''ve released a gem called externals that manages subprojects in an
scm agnostic way so that I can use an svn:externals-like workflow with
git.
It''s used like this: ext install git://github.com/rails/acts_as_list.git
This accomplishes the same thing as:
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
2008 Jan 15
6
Rails plugins that use other plugins - why is does this seem impossible?
OK, probably the most frustrated I''ve ever been with Rails. If I don''t
figure this out, I''m going to, um... try again tomorrow.
I''m simply trying to create a plugin. I did the ./script/generate
plugin MY_NEW_PLUGIN and wha-hoo great! Well, not really...
This plugin uses other plugins. For example, acts_as_list,
acts_as_money etc.. How the heck to I get these
2007 Jun 14
1
HABTM and acts_as_list
I don''t think this needs much explanation. Is what I''m trying to do
even possible?
class CreateLanguagesProducts < ActiveRecord::Migration
create_table languages_products do |t|
t.column :language_id, :integer
t.column :product_id, :integer
t.column :language_position, :integer
end
end
class Language < ActiveRecord::Base
acts_as_list :scope =>
2008 Mar 10
0
Sortables, acts_as_list and performance
Hi!
I have a reordering feature for one of my models. It''s done with
Sortables JS component that sends an Ajax request with a hash of new
positions for each item after reordering, with the following action
that processes it:
def reorder
params[:pos].each do |id, pos|
@user.activities.find(id).insert_at(pos)
end
head :ok
end
I''m using acts_as_list to
2006 Dec 25
2
Active Record acts_as_tree and leaf depth
Using acts_as_tree, is it possible to get information of the depth a
tree leaf in relation to the root? Or is available to derive
information to save in the way "position" can be derived and saved for
acts_as_list.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2008 Feb 22
7
undefined local variable or method "acts_as_list"?
Hi, I''m getting the error below, and I''m not sure where to find
"acts_as_list" ...
NameError in SpecialsController#printer
undefined local variable or method `acts_as_list'' for #<Class:
0xb7a46994>
RAILS_ROOT: /usr/local/apache2/htdocs/dps
Application Trace | Framework Trace | Full Trace
vendor/plugins/trunk/lib/scope_out.rb:70:in