Sha256: af2a7529fe4ca5b67f1d7fa3b224e78c51089cc15c39e794ddc96d72d9cba976

Contents?: true

Size: 1.07 KB

Versions: 13

Compression:

Stored size: 1.07 KB

Contents

module ForemanSalt
  class SaltEnvironmentsController < ::ForemanSalt::ApplicationController
    include Foreman::Controller::AutoCompleteSearch
    include ::ForemanSalt::Concerns::SaltEnvironmentParameters

    before_action :find_resource, :only => [:edit, :update, :destroy]

    def index
      @salt_environments = resource_base.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page])
    end

    def new
      @salt_environment = SaltEnvironment.new
    end

    def create
      @salt_environment = SaltEnvironment.new(salt_environment_params)
      if @salt_environment.save
        process_success
      else
        process_error
      end
    end

    def edit
    end

    def update
      if @salt_environment.update_attributes(salt_environment_params)
        notice _('Successfully updated %s.' % @salt_environment.to_s)
        redirect_to salt_environments_path
      else
        process_error
      end
    end

    def destroy
      if @salt_environment.destroy
        process_success
      else
        process_error
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman_salt-10.1.0 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-8.0.4 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-9.0.1 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-10.0.0 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-9.0.0 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-8.0.3 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-8.0.2 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-8.0.1 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-7.0.3 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-8.0.0 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-7.0.2 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-7.0.1 app/controllers/foreman_salt/salt_environments_controller.rb
foreman_salt-7.0.0 app/controllers/foreman_salt/salt_environments_controller.rb