search for: find_all_by_parent_id

Displaying 4 results from an estimated 4 matches for "find_all_by_parent_id".

2010 Sep 01
1
[PATCH 1/3] Adding the VM Pool migration for vms
...src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -146,6 +146,22 @@ class VmController < ApplicationController render :layout => false end + def edit_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pools = VmResourcePool.find_all_by_parent_id(@vm.vm_resource_pool.parent.id) + render :layout => 'popup' + end + + def update_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pool = VmResourcePool.find(params[:vm][:vm_resource_pool_id]) + @vm.update_attribute(:vm_resource_pool, @vm_pool) + ren...
2008 Jul 31
1
Getting a a list of acts_as_tree items with hierarchy
I''m using acts_as_tree to nest categories n-levels deep and am wondering if anyone out there in Ruby-land knows the best, least expensive way to start with top level categories and then loop recursively through each category going as many levels deep as needed, and then moving to the next top level category, etc. Thanks, Josh -- Posted via http://www.ruby-forum.com/.
2010 Mar 16
3
collection_select has_many
hi i have two models: GeoRegion & GeoRegionSub which have a has_many relation to each other. how can include the has_many relation in the collection_select helper? i want to have that dropdown where the parent is in black and the children indented. <%= collection_select :dl,:parent_id, GeoRegion.all.????, :id, :title %> thx -- You received this message because you are subscribed
2010 Aug 25
0
[PATCH] Adding the VM Pool migration for vms
...src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -146,6 +146,22 @@ class VmController < ApplicationController render :layout => false end + def edit_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pools = VmResourcePool.find_all_by_parent_id(@vm.vm_resource_pool.parent.id) + render :layout => 'popup' + end + + def update_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pool = VmResourcePool.find(params[:vm][:vm_resource_pool_id]) + @vm.update_attribute(:vm_resource_pool, @vm_pool) + ren...