Sha256: 7c1dedb6fb5245958988b40940c1c5cd38bd59ed98c65e2c9681e6aef6753487

Contents?: true

Size: 1.41 KB

Versions: 28

Compression:

Stored size: 1.41 KB

Contents

require_dependency "phcscriptcdnpro/application_controller"

module Phcscriptcdnpro
	class Script::AuthorsController < ApplicationController

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

		# INDEX - Script Author
		def index
			@script_authors = Script::Author.all
		end

		# DETAILS - Script Author
		def show
		end

		# NEW - Script Author
		def new
			@script_author = Script::Author.new
		end

		# EDIT - Script Author
		def edit
		end

		# CREATE - Script Author
		def create
			@script_author = Script::Author.new(script_author_params)
			if @script_author.save
				redirect_to script_authors_url, notice: 'Author was successfully created.'
				else
					render :new
			end
		end

		# PATCH/PUT - Script Author
		def update
			if @script_author.update(script_author_params)
				redirect_to script_authors_url, notice: 'Author was successfully updated.'
				else
					render :edit
			end
		end

		# DELETE - Script Author
		def destroy
			@script_author.destroy
			redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
		end

		private

		# Common Callbacks
		def set_script_author
			@script_author = Script::Author.find(params[:id])
		end

		# Whitelist
		def script_author_params
			params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :listing_id)
		end

	end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
phcscriptcdnpro-5.3.5 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.3.3 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.3.2 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.3.1 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.3.0 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.2.3 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.2.2 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.2.1 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.2.0 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.7 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.6 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.5 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.4 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.3 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.2 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.1 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.1.0 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.0.3 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.0.2 app/controllers/phcscriptcdnpro/script/authors_controller.rb
phcscriptcdnpro-5.0.1 app/controllers/phcscriptcdnpro/script/authors_controller.rb