Sha256: 9fb15c7dc490c924ac8ed7f9d18d9abe2f0805f5e270dc788cc7668d655b36d4

Contents?: true

Size: 1.52 KB

Versions: 54

Compression:

Stored size: 1.52 KB

Contents

require_dependency "phcscriptcdn/application_controller"

module Phcscriptcdn
  class Script::VersionsController < ApplicationController

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

    # INDEX - Script Versions
    def index
    @script_versions = Script::Version.all
    end

    # DETAILS - Script Versions
    def show
    end

    # NEW - Script Versions
    def new
      @script_version = Script::Version.new
    end

    # EDIT - Script Versions
    def edit
    end

    # POST - Script Versions
    def create
      @script_version = Script::Version.new(script_version_params)
      if @script_version.save
        redirect_to script_versions_url, notice: 'Version was successfully created.'
        else
          render :new
      end
    end

    # PATCH/PUT - Script Versions
    def update
      if @script_version.update(script_version_params)
        redirect_to script_versions_url, notice: 'Version was successfully updated.'
        else
          render :edit
      end
    end

    # DELETE - Script Versions
    def destroy
      @script_version.destroy
      redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
    end

    private

    # Common Callbacks
    def set_script_version
      @script_version = Script::Version.find(params[:id])
    end

    # Only allow a trusted parameter "white list" through.
    def script_version_params
      params.require(:script_version).permit(:scriptversion, :slug, :user_id, :user_name)
    end

  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
phcscriptcdn-29.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-28.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-27.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-26.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-25.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-24.0.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-24.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-23.1.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-23.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-22.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-21.2.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-21.1.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-21.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-20.0.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-20.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-19.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-18.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-17.0.1 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-17.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb
phcscriptcdn-16.0.0 app/controllers/phcscriptcdn/script/versions_controller.rb