phcscriptcdnpro 1.5.6 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 012c989ba7c67177fb070b42526d7dc3e8211587
|
4
|
+
data.tar.gz: 6c36b79b6fec9c7f305a79c02a128ca2139bf646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93a24fb20ac223830eac76dd31fe60f82fe3161da702b3633d92d51dadcee7e2076d9a8f94ecc04b0c9f35dfb73f57417e76ca3d2dccac334fdfc31fe90227c3
|
7
|
+
data.tar.gz: 9aecc9ae7d5e3ecbc2ca6c6056a577a14343f5f2ecfb85ee94ae2edea9070bcd1675588cd5977facb6c08ddfde44b726532f22272aa5be3190e2bc1f4eff5194
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require_dependency "phcscriptcdnpro/application_controller"
|
2
2
|
|
3
3
|
module Phcscriptcdnpro
|
4
|
-
class Scriptcdn::
|
4
|
+
class Scriptcdn::UrlsController < ApplicationController
|
5
5
|
|
6
6
|
# Security & Action Filters
|
7
7
|
before_action :require_user
|
8
8
|
layout '/layouts/phcscriptcdnpro/application.html.erb'
|
9
|
-
before_action :
|
9
|
+
before_action :set_scriptcdn_url, only: [:edit, :update, :destroy]
|
10
10
|
|
11
11
|
# Index for Script URL
|
12
12
|
def index
|
@@ -33,10 +33,10 @@ module Phcscriptcdnpro
|
|
33
33
|
# POST Script URL
|
34
34
|
def create
|
35
35
|
@scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
|
36
|
-
@scriptcdn_url = @scriptcdn_main.urls.create(
|
36
|
+
@scriptcdn_url = @scriptcdn_main.urls.create(scriptcdn_url_params)
|
37
37
|
respond_to do |format|
|
38
38
|
if @scriptcdn_url.save
|
39
|
-
format.html { redirect_to
|
39
|
+
format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Created.' }
|
40
40
|
format.json { render action: 'show', status: :created, location: @scriptcdn_url }
|
41
41
|
else
|
42
42
|
format.html { render action: 'new' }
|
@@ -48,8 +48,8 @@ module Phcscriptcdnpro
|
|
48
48
|
# PATCH/PUT Script URL
|
49
49
|
def update
|
50
50
|
respond_to do |format|
|
51
|
-
if @scriptcdn_url.update(
|
52
|
-
format.html { redirect_to
|
51
|
+
if @scriptcdn_url.update(scriptcdn_url_params)
|
52
|
+
format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Updated.' }
|
53
53
|
format.json { head :no_content }
|
54
54
|
else
|
55
55
|
format.html { render action: 'edit' }
|
@@ -64,7 +64,7 @@ module Phcscriptcdnpro
|
|
64
64
|
@scriptcdn_url = @scriptcdn_main.urls.find(params[:id])
|
65
65
|
@scriptcdn_url.destroy
|
66
66
|
respond_to do |format|
|
67
|
-
format.html { redirect_to
|
67
|
+
format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Deleted.' }
|
68
68
|
format.json { head :no_content }
|
69
69
|
end
|
70
70
|
end
|
@@ -72,12 +72,12 @@ module Phcscriptcdnpro
|
|
72
72
|
private
|
73
73
|
|
74
74
|
# Common Callbacks
|
75
|
-
def
|
75
|
+
def set_scriptcdn_url
|
76
76
|
@scriptcdn_url = Scriptcdn::Url.find(params[:id])
|
77
77
|
end
|
78
78
|
|
79
79
|
# Whitelist
|
80
|
-
def
|
80
|
+
def scriptcdn_url_params
|
81
81
|
params.require(:scriptcdn_url).permit(:scripturl, :main_id)
|
82
82
|
end
|
83
83
|
|