Sha256: 724a4d587b3b995e73eb693de5d4e96366bfba9c372da697196a28b565a9d80c

Contents?: true

Size: 1.38 KB

Versions: 19

Compression:

Stored size: 1.38 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
	class Script::VersionsController < ApplicationController

		# Filters & Security
		before_action :set_script_version, only: [:show, :edit, :update, :destroy]

		# INDEX - Script Versions
		def index
			@script_versions = Script::Version.all
		end

		# DETAILS - Script Versions
		def show
		end

		# NEW - Script Versions
		def new
			@script_version = Script::Version.new
		end

		# EDIT - Script Versions
		def edit
		end

		# POST - Script Versions
		def create
			@script_version = Script::Version.new(script_version_params)
			if @script_version.save
				redirect_to script_versions_url, notice: 'Version was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT - Script Versions
		def update
			if @script_version.update(script_version_params)
				redirect_to script_versions_url, notice: 'Version was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE - Script Versions
		def destroy
		@script_version.destroy
		redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_script_version
		@script_version = Script::Version.find(params[:id])
		end

		# Only allow a trusted parameter "white list" through.
		def script_version_params
			params.require(:script_version).permit(:scriptversion)
		end

	end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
phcscriptcdn-3.3.3 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.3.2 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.3.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.3.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.2.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.5 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.4 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.3 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.2 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.1.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.7 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.6 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.5 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.4 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.2 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-3.0.0.pre.beta app/controllers/phcscriptcdn/script/versions_controller.rb