Sha256: 50452cb55bed8540d3e3e802bce76003cd77fbac487cc36e12128659fc1cee7b

Contents?: true

Size: 1.44 KB

Versions: 29

Compression:

Stored size: 1.44 KB

Contents

require_dependency "phcscriptcdnpro/application_controller"

module Phcscriptcdnpro
	class Scriptcdn::VersionsController < ApplicationController

		# Security & Action Filters
		before_action :require_user
		layout '/layouts/phcscriptcdnpro/application.html.erb'
		before_action :set_scriptcdn_version, only: [:edit, :update, :destroy]

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

		# New Script Version
		def new
			@scriptcdn_version = Scriptcdn::Version.new
		end

		# Edit Script Version
		def edit
		end

		# POST Script Version
		def create
			@scriptcdn_version = Scriptcdn::Version.new(scriptcdn_version_params)
			if @scriptcdn_version.save
				redirect_to scriptcdn_versions_url, notice: 'Script version was successfully created.'
				else
					render :new
			end
		end

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

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

		private

		# Callbacks
		def set_scriptcdn_version
			@scriptcdn_version = Scriptcdn::Version.find(params[:id])
		end

		# Whitelist
		def scriptcdn_version_params
			params.require(:scriptcdn_version).permit(:scriptversion)
		end

	end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
phcscriptcdnpro-1.8.3 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.2 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.1 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.0 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.11 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.10 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.9 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.8 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.7 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.5 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.7.0 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.9 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.8 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.7 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.6 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.5 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.1 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.6.0 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.5.9 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.5.8 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb