Sha256: 505522b27981cc7d6d1316d9d8f07b84e46a6b1b27dfed3b5dd99eaa14f10d5b

Contents?: true

Size: 1.55 KB

Versions: 9

Compression:

Stored size: 1.55 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
  class Script::AuthorsController < ApplicationController
  
    # Filters & Security
    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, :user_id, :user_name)
    end
  
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
phcscriptcdn-5.1.2 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-5.1.1 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-5.1.0 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-5.0.1 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-5.0.0 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-4.3.10 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-4.3.9 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-4.3.8 app/controllers/phcscriptcdn/script/authors_controller.rb
phcscriptcdn-4.3.7 app/controllers/phcscriptcdn/script/authors_controller.rb