Sha256: e800604eeb533feb320b87d343ced55e67d49c128eb423546cca6baf9b5e00e3

Contents?: true

Size: 1.5 KB

Versions: 11

Compression:

Stored size: 1.5 KB

Contents

require_dependency "phcscriptcdnpro/application_controller"

module Phcscriptcdnpro
	class Script::ListingsController < ApplicationController

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

		# INDEX - Script Listings
		def index
			@script_listings = Script::Listing.all
		end

		# DETAILS - Script Listings
		def show
		end

		# NEW - Script Listings
		def new
			@script_listing = Script::Listing.new
		end

		# EDIT - Script Listings
		def edit
		end

		# POST - Script Listings
		def create
			@script_listing = Script::Listing.new(script_listing_params)
			if @script_listing.save
				redirect_to script_listings_url, notice: 'Listing was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT - Script Listings
		def update
			if @script_listing.update(script_listing_params)
				redirect_to script_listings_url, notice: 'Listing was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE - Script Listings
		def destroy
			@script_listing.destroy
			redirect_to script_listings_url, notice: 'Listing was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_script_listing
			@script_listing = Script::Listing.find(params[:id])
		end

		# Whitelist
		def script_listing_params
			params.require(:script_listing).permit(:scripttitle, :scriptdescription, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlastestrelease, :scriptbetarelease, :scriptstatus, :version_id)
		end

	end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
phcscriptcdnpro-3.3.3 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.3.1 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.3.0 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.2.2 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.2.1 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.2.0 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.1.1 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.1.0 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.0.5 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.0.1 app/controllers/phcscriptcdnpro/script/listings_controller.rb
phcscriptcdnpro-3.0.0 app/controllers/phcscriptcdnpro/script/listings_controller.rb