Sha256: 67ddd842c62cd8a5dcb60d19a775552a04d1b2f3743ff428ccc3448925f0e6f0

Contents?: true

Size: 1.43 KB

Versions: 21

Compression:

Stored size: 1.43 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(:version)
		end

	end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
phcscriptcdnpro-1.10.1 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.10.0 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.12 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.11 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.10 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.8 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.7 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.6 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.5 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.4 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.2 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.1 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.9.0 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.11 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.10 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.9 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.8 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.7 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.6 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb
phcscriptcdnpro-1.8.5 app/controllers/phcscriptcdnpro/scriptcdn/versions_controller.rb