Sha256: 494052effa3b6aa508bb41c161e50a645bd2beb5ea9a82528cddf5705cd842db

Contents?: true

Size: 1.64 KB

Versions: 10

Compression:

Stored size: 1.64 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
  class Script::LicencesController < ApplicationController
  
    # Filters & Security
    before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
    
    # INDEX - Script Licences
    def index
      @script_licences = Script::Licence.all
    end
    
    # DETAILS - Script Licences
    def show
    end
    
    # NEW - Script Licences
    def new
      @script_licence = Script::Licence.new
    end
    
    # EDIT - Script Licences
    def edit
    end
    
    # POST - Script Licences
    def create
      @script_licence = Script::Licence.new(script_licence_params)
      if @script_licence.save
        redirect_to script_licences_url, notice: 'Licence was successfully created.'
        else
          render :new
      end
    end
    
    # PATCH/PUT - Script Licences
    def update
      if @script_licence.update(script_licence_params)
        redirect_to script_licences_url, notice: 'Licence was successfully updated.'
        else
          render :edit
      end
    end
    
    # DELETE - Script Licences
    def destroy
      @script_licence.destroy
      redirect_to script_licences_url, notice: 'Licence was successfully destroyed.'
    end
    
    private
    
    # Common Callbacks
    def set_script_licence
      @script_licence = Script::Licence.find(params[:id])
    end
    
    # Whitelists
    def script_licence_params
      params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :user_id, :user_name)
    end
  
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
phcscriptcdn-4.3.6 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.5 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.4 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.3 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.2 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.1 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.3.0 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.2.1 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.2.0 app/controllers/phcscriptcdn/script/licences_controller.rb
phcscriptcdn-4.1.0 app/controllers/phcscriptcdn/script/licences_controller.rb