Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Help! acts_as_nested_set Administration (add new item, delete item)

Reply
Thread Tools

Help! acts_as_nested_set Administration (add new item, delete item)

 
 
Namor
Guest
Posts: n/a
 
      01-19-2006
Hi guys,

I'm very very new to ruby and i'm trying to use acts_as_nested_set to
create a database driver DHTML menu

eg

Home
Code
|-- Ruby
| -- Rails
About us

The problem comes because I cant find any tutorials and the
documentation doesnt help much

Can someone show me how to create an administration for this DHTML menu
module (scaffold style will do, and dont worry bout how to generate the
menu. that is another problem)?

I'm having problem trying to add items as a child..
eg.. Ruby as a child of code, Rails as a child of Ruby

Any help will be greatly appreciated!




My current rough & nooby code

def create
@place = Place.new(params[lace])
@place.save
@parent = Place.find(@place.parent_id) unless @place.parent_id == 0
if @parent
if @parent.add_child(@place)
flash[:notice] = 'Place was successfully created.'
redirect_to :action => 'list'

else
render :action => 'new' #display error msg
end
else
redirect_to :action => 'list'
end
end

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"return delete (new int)" compile but "return delete (new X X C++ 4 07-19-2010 05:47 PM
Cannot delete user with Web Site Administration Tool =?Utf-8?B?Um9nZXIgTWFydGlu?= ASP .Net 3 03-29-2007 02:02 AM
Mixing new/delete and operator new/delete? Jef Driesen C++ 1 01-19-2005 01:56 PM
Overloading new[] and delete[]: how do they vary from new and delete? HeroOfSpielburg C++ 1 08-06-2003 03:58 AM



Advertisments