Sha256: 37e16cf715165a830f71696aa947dc7973be395ccfc71020580de143a2281f3c

Contents?: true

Size: 1.44 KB

Versions: 19

Compression:

Stored size: 1.44 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
	class Script::ExtensionsController < ApplicationController

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

		# INDEX - Script Extension
		def index
			@script_extensions = Script::Extension.all
		end

		# DETAILS - Script Extension
		def show
		end

		# NEW - Script Extension
		def new
			@script_extension = Script::Extension.new
		end

		# EDIT - Script Extension
		def edit
		end

		# CREATE - Script Extension
		def create
			@script_extension = Script::Extension.new(script_extension_params)
			if @script_extension.save
				redirect_to script_extensions_url, notice: 'Extension was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT - Script Extension
		def update
			if @script_extension.update(script_extension_params)
				redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE - Script Extension
		def destroy
			@script_extension.destroy
			redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_script_extension
			@script_extension = Script::Extension.find(params[:id])
		end

		# Whitelists
		def script_extension_params
			params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension)
		end

	end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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