Sha256: 4f093f360d0f2a68d2f67a8cc650c50f6966b247aaed2dc7a5b2f0364b216123
Contents?: true
Size: 1.12 KB
Versions: 48
Compression:
Stored size: 1.12 KB
Contents
module ForemanPuppet class EnvironmentsController < ApplicationController include Foreman::Controller::AutoCompleteSearch include ForemanPuppet::EnvironmentsImport include ForemanPuppet::Parameters::Environment before_action :find_resource, only: %i[edit update destroy] def index @environments = resource_base_search_and_page # AuthorizerHelper#authorizer uses controller_name as variable name, but it fails with namespaces @authorizer = Authorizer.new(User.current, collection: @environments) end def new @environment = model_of_controller.new end def create @environment = model_of_controller.new(environment_params) if @environment.save process_success else process_error end end def edit end def update if @environment.update(environment_params) process_success else process_error end end def destroy if @environment.destroy process_success else process_error end end def resource_class model_of_controller end end end
Version data entries
48 entries across 48 versions & 1 rubygems