Sha256: 67ddd842c62cd8a5dcb60d19a775552a04d1b2f3743ff428ccc3448925f0e6f0
Contents?: true
Size: 1.43 KB
Versions: 21
Compression:
Stored size: 1.43 KB
Contents
require_dependency "phcscriptcdnpro/application_controller" module Phcscriptcdnpro class Scriptcdn::VersionsController < ApplicationController # Security & Action Filters before_action :require_user layout '/layouts/phcscriptcdnpro/application.html.erb' before_action :set_scriptcdn_version, only: [:edit, :update, :destroy] # Script Version Index def index @scriptcdn_versions = Scriptcdn::Version.all end # New Script Version def new @scriptcdn_version = Scriptcdn::Version.new end # Edit Script Version def edit end # POST Script Version def create @scriptcdn_version = Scriptcdn::Version.new(scriptcdn_version_params) if @scriptcdn_version.save redirect_to scriptcdn_versions_url, notice: 'Script version was successfully created.' else render :new end end # PATCH/PUT Script Version def update if @scriptcdn_version.update(scriptcdn_version_params) redirect_to scriptcdn_versions_url, notice: 'Script version was successfully updated.' else render :edit end end # DELETE Script Version def destroy @scriptcdn_version.destroy redirect_to scriptcdn_versions_url, notice: 'Script version was successfully destroyed.' end private # Callbacks def set_scriptcdn_version @scriptcdn_version = Scriptcdn::Version.find(params[:id]) end # Whitelist def scriptcdn_version_params params.require(:scriptcdn_version).permit(:version) end end end
Version data entries
21 entries across 21 versions & 1 rubygems