app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb in phcscriptcdn-0.7.0 vs app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb in phcscriptcdn-0.9.1
- old
+ new
@@ -5,40 +5,40 @@
# Filters and Security
before_action :set_scriptcdn_scripturl, only: [:show, :edit, :update, :destroy]
# Index for Scriptcdn_script URLs
def index
- scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturls = scriptcdn_script.scripturls
+ scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturls = scriptcdn_scriptversion.scripturls
end
# Scriptcdn_script URL Details Page
def show
- scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturl = scriptcdn_script.scripturls.find(params[:id])
+ scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturl = scriptcdn_scriptversion.scripturls.find(params[:id])
end
# New Scriptcdn_script URL
def new
- scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturl = scriptcdn_script.scripturls.build
+ scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturl = scriptcdn_scriptversion.scripturls.build
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @scriptcdn_script }
end
end
# Edit Scriptcdn_script URL
def edit
- scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturl = scriptcdn_script.scripturls.find(params[:id])
+ scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturl = scriptcdn_scriptversion.scripturls.find(params[:id])
end
# POST Scriptcdn_script URL
def create
- @scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturl = @scriptcdn_script.scripturls.create(scriptcdn_scripturl_params)
+ @scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturl = @scriptcdn_scriptversion.scripturls.create(scriptcdn_scripturl_params)
respond_to do |format|
if @scriptcdn_scripturl.save
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Created.' }
format.json { render action: 'show', status: :created, location: @scriptcdn_scripturl }
else
@@ -61,12 +61,12 @@
end
end
# Delete Scriptcdn_script URL
def destroy
- @scriptcdn_script = Scriptcdn::Script.find(params[:script_id])
- @scriptcdn_scripturl = @scriptcdn_script.scripturls.find(params[:id])
+ @scriptcdn_scriptversion = Scriptcdn::Scriptversion.find(params[:script_id])
+ @scriptcdn_scripturl = @scriptcdn_scriptversion.scripturls.find(params[:id])
@scriptcdn_scripturl.destroy
respond_to do |format|
format.html { redirect_to scriptcdn_script_scripturls_path, notice: 'Script URL was Successfully Deleted.' }
format.json { head :no_content }
end
@@ -79,9 +79,9 @@
@scriptcdn_scripturl = Scriptcdn::Scripturl.find(params[:id])
end
# Whitelist
def scriptcdn_scripturl_params
- params.require(:scriptcdn_scripturl).permit(:scrpturlname, :scrpturlphc, :scrpturltype, :scriptversion_id, :script_id)
+ params.require(:scriptcdn_scripturl).permit(:scrpturlname, :scrpturlphc, :scrpturltype, :scriptversion_id)
end
end
-end
+end
\ No newline at end of file