Sha256: c644cf33a600daa91e5c812bd936281f1949df432f0f7e9ce8adfbd5365292d9

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

module ForemanSalt
  class SaltModulesController < ::ForemanSalt::ApplicationController
    include Foreman::Controller::AutoCompleteSearch

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

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

    def new
      @salt_module = SaltModule.new
    end

    def create
      logger.info("Params: #{params.inspect}")
      @salt_module = SaltModule.new(params[:foreman_salt_salt_module])
      if @salt_module.save
        process_success
      else
        process_error
      end
    end

    def edit
    end

    def update
      if @salt_module.update_attributes(params[:foreman_salt_salt_module])
        notice _('Successfully updated %s.' % @salt_module.to_s)
        redirect_to salt_modules_path
      else
        process_error
      end
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_salt-2.0.2 app/controllers/foreman_salt/salt_modules_controller.rb
foreman_salt-2.0.1 app/controllers/foreman_salt/salt_modules_controller.rb
foreman_salt-2.0.0 app/controllers/foreman_salt/salt_modules_controller.rb