But I can I set now the controller actions new and create?
This code creates two managers and not only one:
def new
@company = Company.find(params[:company_id])
@manager = Manager.new
@manager.managements.build
new!
end
def create
@company = Company.find(params[:company_id])
@manager = @company.managers.build(params[:manager])
@manager.company_ids = @company.id
create!
end
--
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@googlegroups.com.
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.
No comments:
Post a Comment