Displaying 2 results from an estimated 2 matches for "parent_invitee".
2009 Feb 20
1
better nested set and parent_id
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
2009 Feb 20
0
Nested set - problems when creating child item
...r 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.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....