Sha256: 6f117b73be24534b1203fed0785b1d9ed7ad91f737750065d95e029e84e6e019

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

require_dependency "phcscriptcdnpro/application_controller"

module Phcscriptcdnpro
	class Scriptcdn::MainsController < ApplicationController

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

		# Script CDN Backend Index
		def index
			@scriptcdn_mains = Scriptcdn::Main.all
		end

		# New Script Listing
		def new
			@scriptcdn_main = Scriptcdn::Main.new
		end

		# Edit Script Listing
		def edit
		end

		# POST Script CDN
		def create
			@scriptcdn_main = Scriptcdn::Main.new(scriptcdn_main_params)
			if @scriptcdn_main.save
				redirect_to scriptcdn_mains_url, notice: 'Script was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT Script
		def update
			if @scriptcdn_main.update(scriptcdn_main_params)
				redirect_to scriptcdn_mains_url, notice: 'Script was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE Script
		def destroy
			@scriptcdn_main.destroy
			redirect_to scriptcdn_mains_url, notice: 'Main was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_scriptcdn_main
			@scriptcdn_main = Scriptcdn::Main.find(params[:id])
		end

		# Whitelist
		def scriptcdn_main_params
			params.require(:scriptcdn_main).permit(:information_id, :version_id)
		end

	end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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