Forum: Ruby on Rails Nested set - problems when creating child item

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
cassiozen (Guest)
on 2009-02-20 17:18
(Received via mailing list)

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 property "parent_id"

How can i avoid this warning? Below is my create action:

def create
    @invite =[:invite])
      @parent_invitee = Invite.find_by_id(params[:invite][:parent_id])
    rescue Exception => exc
        logger.error("Invalid parent_id: #{exc.message}")
        render :action => "new"
    respond_to do |format|
        flash[:notice] = 'Invite was successfully created.'
        format.html { redirect_to :action => "show" }
This topic is locked and can not be replied to.