Here is my controller''s update action:
def create
@invite = Invite.new(params[:invite])
begin
@parent_invitee = Invite.find_by_id(params[:invite][:parent_id])
rescue Exception => exc
logger.error("Invalid parent_id: #{exc.message}")
render :action => "new"
end
respond_to do |format|
if @invite.save
@invite.move_to_child_of(@parent_invitee.id)
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 }
else
format.html { render :action => "new" }
format.xml { render :xml => @invite.errors, :status
=> :unprocessable_entity }
end
end
end
On Feb 19, 11:48 pm, cassiozen
<cassio...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
> (params[item][parent_id])
>
> 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---