Sha256: 9c25a1fbc291b7128e63be5005e359b8e605c2a0aec84c1cac9e4d3eed43b835

Contents?: true

Size: 1.7 KB

Versions: 16

Compression:

Stored size: 1.7 KB

Contents

require_dependency "phcscriptcdnpro/application_controller"

module Phcscriptcdnpro
	class Scriptcdn::InformationsController < ApplicationController

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

		# Script Information Index
		def index
			@scriptcdn_informations = Scriptcdn::Information.all
		end

		# New Script Information
		def new
			@scriptcdn_information = Scriptcdn::Information.new
		end

		# Edit Script Information
		def edit
		end

		# POST Script Information
		def create
			@scriptcdn_information = Scriptcdn::Information.new(scriptcdn_information_params)

			if @scriptcdn_information.save
				redirect_to scriptcdn_informations_url, notice: 'Information was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT Script Information
		def update
			if @scriptcdn_information.update(scriptcdn_information_params)
				redirect_to scriptcdn_informations_url, notice: 'Information was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE Script Information
		def destroy
			@scriptcdn_information.destroy
			redirect_to scriptcdn_informations_url, notice: 'Information was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_scriptcdn_information
			@scriptcdn_information = Scriptcdn::Information.find(params[:id])
		end

		# Whitelist
		def scriptcdn_information_params
			params.require(:scriptcdn_information).permit(:scripttitle, :scriptdescription, :scriptcategory, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlicence, :scriptplatform, :version_id, :main_id)
		end

	end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
phcscriptcdnpro-1.9.0 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.11 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.10 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.9 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.8 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.7 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.6 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.5 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.4 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.3 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.2 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.1 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.8.0 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.7.11 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.7.10 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb
phcscriptcdnpro-1.7.9 app/controllers/phcscriptcdnpro/scriptcdn/informations_controller.rb