Class: Staypuft::SubnetTypingsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Staypuft::SubnetTypingsController
- Defined in:
- app/controllers/staypuft/subnet_typings_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/controllers/staypuft/subnet_typings_controller.rb', line 3 def create @deployment = Deployment.find(params[:deployment_id]) @subnet_type = SubnetType.find(params[:subnet_type_id]) @subnet = Subnet.find(params[:subnet_id]) check_for_existing_assignments @subnet_typing = @deployment.subnet_typings.new(:subnet_id => @subnet.id, :subnet_type_id => @subnet_type.id) @saved = @subnet_typing.save end |
#destroy ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/controllers/staypuft/subnet_typings_controller.rb', line 22 def destroy @subnet_typing = SubnetTyping.find(params[:id]) @deployment = @subnet_typing.deployment @subnet = @subnet_typing.subnet check_for_existing_assignments @subnet_type = @subnet_typing.subnet_type @destroyed = @subnet_typing.destroy end |
#update ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/staypuft/subnet_typings_controller.rb', line 12 def update @subnet_typing = SubnetTyping.find(params[:id]) @deployment = @subnet_typing.deployment @subnet_type = @subnet_typing.subnet_type @subnet = Subnet.find(params[:subnet_id]) check_for_existing_assignments @subnet_typing.subnet = @subnet @saved = @subnet_typing.save end |