Sha256: 3212d3fd4558b6ec601df62ba3616bf06414e8fb4a3a6b7c0e2a68f1aba5a839

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
	class Scriptcdn::ScriptversionsController < ApplicationController

		# Filters and Security
		before_action :set_scriptcdn_scriptversion, only: [:edit, :update, :destroy]

		# Script Version Index
		def index
			@scriptcdn_scriptversions = Scriptcdn::Scriptversion.all
		end

		# New Script Version for CDN
		def new
			@scriptcdn_scriptversion = Scriptcdn::Scriptversion.new
		end

		# Edit Script Version
		def edit
		end

		# POST Script Version
		def create
			@scriptcdn_scriptversion = Scriptcdn::Scriptversion.new(scriptcdn_scriptversion_params)

			if @scriptcdn_scriptversion.save
				redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully created.'
			else
				render :new
			end
		end

		# PATCH/PUT Script Version
		def update
			if @scriptcdn_scriptversion.update(scriptcdn_scriptversion_params)
				redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully updated.'
			else
				render :edit
			end
		end

		# DELETE Script Version
		def destroy
			@scriptcdn_scriptversion.destroy
			redirect_to scriptcdn_scriptversions_path, notice: 'Script version was successfully destroyed.'
		end

		private
		
		# Callbacks
		def set_scriptcdn_scriptversion
			@scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:id])
		end

		# Whitelist
		def scriptcdn_scriptversion_params
			params.require(:scriptcdn_scriptversion).permit(:scrptversion, :scrptversionpakname)
		end

	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
phcscriptcdn-1.0.3 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-1.0.2 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-1.0.1 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-1.0.0 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.10 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.9 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.8 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.7 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.6 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.5 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.3 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.2 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb
phcscriptcdn-0.9.1 app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb