Displaying 1 result from an estimated 1 matches for "treestruct".
Did you mean:
tree_struct
2011 Nov 23
0
Awesome nested set - how to put there items?
...+
In the form where I create a new items to the tree structure I have in a
hidden input always the parent of item, that I just create.
In a controller I do this:
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
save_tree = TreeStruct.create!(:user_id => @user.id)
save_tree.move_to_child_of(params[:parent])
format.html { redirect_to(root_url, :notice => ''OK.'') }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else...