Class: DiscoveryRulesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- DiscoveryRulesController
- Defined in:
- app/controllers/discovery_rules_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #disable ⇒ Object
- #edit ⇒ Object
- #enable ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/discovery_rules_controller.rb', line 16 def create @discovery_rule = DiscoveryRule.new(params[:discovery_rule]) if @discovery_rule.save process_success else process_error end end |
#destroy ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/controllers/discovery_rules_controller.rb', line 36 def destroy if @discovery_rule.destroy process_success else process_error end end |
#disable ⇒ Object
48 49 50 |
# File 'app/controllers/discovery_rules_controller.rb', line 48 def disable set_enabled false end |
#edit ⇒ Object
25 26 |
# File 'app/controllers/discovery_rules_controller.rb', line 25 def edit end |
#enable ⇒ Object
44 45 46 |
# File 'app/controllers/discovery_rules_controller.rb', line 44 def enable set_enabled true end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/discovery_rules_controller.rb', line 7 def index base = resource_base.search_for(params[:search], :order => (params[:order] || 'priority ASC')) @discovery_rules = base.paginate(:page => params[:page]).includes(:hostgroup) end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/discovery_rules_controller.rb', line 12 def new @discovery_rule = DiscoveryRule.new end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/discovery_rules_controller.rb', line 28 def update if @discovery_rule.update_attributes(params[:discovery_rule]) process_success else process_error end end |