Displaying 20 results from an estimated 900 matches similar to: "better nested set and parent_id"
2009 Feb 20
0
Nested set - problems when creating child item
Hi,
I''ve created a Model with Better Nested Set, but i''m having problems
to create child items
My workflow is:
- In the (new) form, i pass the desired parent_id in a hidden field.
- In the create action, i create the register and after saving it i
use the move_to_child_of method.
Everything works! My only problem is that Rails warns that I can''t
mass asign the
2009 May 22
1
[PATCH server] fix for BZ #477796: pool name uniqueness
We already had the validation rule in place, but the way the betternestedset API sets the parent_id the rules were being bypassed.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/app/models/pool.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index 2979fcb..0a63723 100644
--- a/src/app/models/pool.rb
2007 Jul 18
10
Rails - Mock going out of scope?
Hello list,
I think I have a rails related RSpec problem with a mock going out of
scope on a recursive call to a model.
The code is at: http://pastie.textmate.org/79821 if you want to see it
highlighted. I have pasted it below as well.
Basically, I have an acts_as_nested_set model called "Node", which
works fine. I have a function which finds the language name of the
node instance.
2006 Aug 06
2
better_nested_set plugin
Hi,
I''m pleased to announce that the better_nested_set plugin is released.
It ehances acts_as_nested_set, adding methods to move parts of the
tree, like:
* move_to_child_of
* move_to_right_of
* move_to_left_of
Pass them an id or an object.
Other methods added by this mixin are:
* root - root item of the tree (the one that has a nil parent;
should have left_column =
2009 Aug 19
10
acts_as_list / acts_as_tree / acts_as_nested_set - which one
I am creating forum application which needs usage of acts_as_list or
acts_as_tree or acts_as_nested_set.
I am unable to decide among these. please could some one recommend from
their experience?
--
Posted via http://www.ruby-forum.com/.
2010 Jan 25
9
skinny Controllers, fat models with REST?
Hi,
I''m really new to rails, so i programmed some stuff and today i read
some things about skinny Controllers, fat models.
My Controllers are really fat now. So i''m asking myself how can i
shrink my controllers and move the code to the models, especially in
fact of REST e.g. in focus on error codes?
code example:
# POST /tasks
# POST /tasks.xml
def create
@authorized
2007 Mar 27
7
Eager loading not working well for me
Man my app is causing me so much grief lately.
Okay let''s say I have:
class Discussion
has_many :posts
end
class Post
belongs_to :discussion
acts_as_tree
end
Then let''s say I grab a discussion object and try to eager load all of
its posts:
discussion = Discussion.find(:first, :include => [:posts])
Seems simple enough and it grabs an entire tree of posts. However:
2010 May 12
3
Best Gem For Threaded Comment Storage?
Dear List,
Given that I am developing a rails 2.3.5 site,
When it comes to storing threaded comments in a blog or forum,
Then which plugin/gem should be considered "State of the Art"?
I''m starting with these URLs:
http://github.com/rails/acts_as_tree
http://github.com/rails/acts_as_nested_set
http://github.com/collectiveidea/awesome_nested_set
2007 Apr 29
1
better nested set and :through
Hello all,
It''s been a while since i''ve been doing any rails development, so i''m a
bit rusty. Having found this:
http://opensource.symetrie.com/api/better_nested_set/
it looks really interesting and useful for solving something i''m trying
to get working.
What i have (essentially) is the following models:
class Group < ActiveRecord::Base
2011 Mar 08
2
Rails - Acts as Nested - Impossible move, target node cannot be inside moved tree.
Hello, I''m using the Awesome Nested Set plugin:
https://github.com/collectiveidea/awesome_nested_set
And in my model I do the following:
acts_as_nested_set
after_save :ensure_max_nestedset_level
private
def ensure_max_nestedset_level
if self.level > 2
self.move_to_child_of(parent.parent)
end
end
I do this to keep the levels from getting
2005 Mar 06
2
Using url_for in ActionMailer templates
Hi All
I am just adding some basic e-mail notices to my Rails app using
ActionMailer, and have one small issue. I want to provide a
confirmation URL to users who sign up for an account. I can obviously
just hardcode the URL and append the confirmation code to it, but I''d
much rather be able to use something like:
url_for(:controller => ''authentication'', :action
2007 May 02
3
acts_as_tree related question
hi,
I''ve a normal Category model implemented with acts_as_tree (name,
parent_id) that has_many :products (name, category_id).
What I''m asking for is a method to fetch every product that belongs
fall into a particular category and its children, eg: if I''m asking
for a root node (/category/show/1) I need to display every product
that have category_id = 1 AND every product
2009 Oct 14
0
[PATCH server] hack betternested set to enable pool deletion
This is an ugly hack to fix the betternestedset plugin as currently
a bug does not allow pools to be deleted. The single line commented
out in this patch deletes the pool itself instead of only its children
for whatever reason.
This wouldn't be a problem were it not for the recent
change to active record which enforces optimistic locking upon
destroy operations. Since the database record is
2011 Nov 23
0
Awesome nested set - how to put there items?
hello guys,
I have following structure of the table, where I store items of tree:
| id | int(11) | NO | PRI | NULL | auto_increment |
| user_id | int(11) | YES | | NULL | |
| parent_id | int(11) | YES | | NULL | |
| lft | int(11) | YES | | NULL | |
| rgt | int(11) | YES
2009 Nov 26
2
[error] avahi_entry_group_add_service_strlst("AdminNodeFQDN") failed: Invalid host name
Hi,
After doing a clean install of ovirt in a Fedora 11 VM, I am unable to
get anything working in the web interface. All I get is an error 500.
After reviewing the logs I see the following error in
/var/log/http/error.log
[Thu Nov 26 11:29:11 2009] [notice] Apache/2.2.13 (Unix) DAV/2
mod_auth_kerb/5.4 mod_nss/2.2.11 NSS/3.12.2.0 mod_python/3.3.1
Python/2.6 configured -- resuming normal
2009 Feb 17
8
Converting Acts_As_Tree to Acts_As_Nested_Set
Hello,
I have a tree structure that needs to be converted into a nested set.
A great deal of work has already been done on the tree items, so
maintaining the integrity of the id''s is mandatory. However I need
the ability to access entire branches of the tree, which is what
Nested set does. Does anyone have any suggestions on how to
efficiently transfer the tree to the nested set and
2010 Mar 08
0
betternestedset in rails 3.0
Hi Guys,
when i upgraded my rails 2.3.4 to 3.0 my betternestedset is not working.
It was working fine in the older version. This is my controller
def new
cat = Category.new
cat.text=''test''
cat.save
cat.move_to_child_of(Category.find_by_id(1)) #26
redirect_to :action => ''index''
end
It gives me this error : "You cannot move a
2006 Apr 06
3
Inserting parent_id
I have two tables:
- projects
- lines
lines has a foreign key constraint to projects.id
When I''m creating a new line object, the database fails on insert with
the following error:
"PGError: ERROR: null value in column "project_id" violates not-null
constraint"
My code looks like this:
def create_lines
@project = params[:id]
@line =
2007 Jan 13
0
better nested set 0.1
We are pleased to announce the 0.1 release of the plugin
betternestedset. It greatly enhances ActiveRecord''s internal
acts_as_nested_set.
Install it with:
script/plugin install
svn://rubyforge.org/var/svn/betternestedset/tags/stable/betternestedset
Join the mailing list:
http://rubyforge.org/mailman/listinfo/betternestedset-talk
Report bugs:
2013 Mar 04
2
Model/google maps display
Hi all,
I''m building a ror app and have a model with geo-coordinates would like to
use the info in the model to generate a google map view, does anyone know
what''s the best way to go round this?
is is Google API?, I''ve also seen a gmaps4rails, any comments?
Thank you in advance,
Jax
--
You received this message because you are subscribed to the Google Groups