Class: ForemanResourceQuota::ResourceQuotasController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ForemanResourceQuota::ResourceQuotasController
- Includes:
- Foreman::Controller::AutoCompleteSearch, Foreman::Controller::Parameters::ResourceQuota
- Defined in:
- app/controllers/foreman_resource_quota/resource_quotas_controller.rb
Instance Method Summary collapse
Methods included from Foreman::Controller::Parameters::ResourceQuota
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 22 def create @resource_quota = ResourceQuota.new(resource_quota_params) if @resource_quota.save process_success else process_error end end |
#destroy ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 42 def destroy if @resource_quota.destroy process_success else process_error end end |
#edit ⇒ Object
31 32 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 31 def edit end |
#index ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 10 def index @resource_quotas = resource_base.search_for(params[:search], order: params[:order]).paginate(page: params[:page], per_page: params[:per_page]) # TODO: Check necessitiy/purpose of authorizer # AuthorizerHelper#authorizer uses controller_name as variable name, but it fails with namespaces # @authorizer = Authorizer.new(User.current, collection: @resource_quotas) end |
#new ⇒ Object
18 19 20 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 18 def new @resource_quota = ResourceQuota.new end |
#update ⇒ Object
34 35 36 37 38 39 40 |
# File 'app/controllers/foreman_resource_quota/resource_quotas_controller.rb', line 34 def update if @resource_quota.update(resource_quota_params) process_success else process_error end end |