Sha256: 5f835d8781ff756d04f4b09b9becf1e1871d556ff296be9cca054466b85df4f7

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

class CommonParametersController < ApplicationController
  include Foreman::Controller::AutoCompleteSearch

  def index
    values = CommonParameter.search_for(params[:search], :order => params[:order])
    respond_to do |format|
      format.html { @common_parameters = values.paginate(:page => params[:page]) }
      format.json { render :json => values}
    end
  end

  def new
    @common_parameter = CommonParameter.new
  end

  def create
    @common_parameter = CommonParameter.new(params[:common_parameter])
    if @common_parameter.save
      process_success
    else
      process_error
    end
  end

  def edit
    @common_parameter = CommonParameter.find(params[:id])
  end

  def update
    @common_parameter = CommonParameter.find(params[:id])
    if @common_parameter.update_attributes(params[:common_parameter])
      process_success
    else
      process_error
    end
  end

  def destroy
    @common_parameter = CommonParameter.find(params[:id])
    if @common_parameter.destroy
      process_success
    else
      process_error
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/app/controllers/common_parameters_controller.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/app/controllers/common_parameters_controller.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/app/controllers/common_parameters_controller.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/app/controllers/common_parameters_controller.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/app/controllers/common_parameters_controller.rb