Forum: Ruby on Rails better nested set and parent_id

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 04:49
(Received via mailing list)
Hello everybody

I have a model with better_nested_set. In my "new" form, i pass the
desired parent_id as a hidden field, and in the create action at the
controller i save the new register and use move_to_child_of Model

Everything works, but at my log file it warns that i can't mass asign
the property "parent_id".

What can i do to avoid the warning?
cassiozen (Guest)
on 2009-02-20 14:43
(Received via mailing list)
Here is my controller's update 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", :id =>
@invite.confirmation_code }
        format.xml  { render :xml => @invite, :status
=> :created, :location => @invite }
          format.html { render :action => "new" }
          format.xml  { render :xml => @invite.errors, :status
=> :unprocessable_entity }
This topic is locked and can not be replied to.