phcscriptcdnpro 2.0.0 → 2.0.1
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: adee241723545c98c2e35de72aa259a4fa30ef9c
|
4
|
+
data.tar.gz: c73216b7dbda93b26da6961d70e331debe6e66fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9419e2573258e0442687df4bf172167ef98b7f2a81c4f9479187a273412e7de78fb887137c75c5aae414637b2ef5cdcf7e51644e622ddcba24ada1ebbbf47c90
|
7
|
+
data.tar.gz: b7d015c405935c720eb198fe1230d68c644c7d0df3f0a1303859d5e79d23d8eb59dfe34b4eabf339bcff5bee2ca98ce56e0cefe5dd12d9d45a4e4686450a8d3d
|
@@ -3,15 +3,9 @@ require_dependency "phcscriptcdnpro/application_controller"
|
|
3
3
|
module Phcscriptcdnpro
|
4
4
|
class Api::MainsController < ApplicationController
|
5
5
|
|
6
|
-
# Only Responds to API Requests
|
7
|
-
respond_to :json
|
8
|
-
|
9
6
|
# Script List API
|
10
7
|
def index
|
11
8
|
@scriptcdn_mains = Scriptcdn::Main.all
|
12
|
-
respond_to do |format|
|
13
|
-
format.json { render :json => @scriptcdn_mains }
|
14
|
-
end
|
15
9
|
end
|
16
10
|
|
17
11
|
# Script Show API
|
@@ -18,10 +18,6 @@ module Phcscriptcdnpro
|
|
18
18
|
def new
|
19
19
|
scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
|
20
20
|
@scriptcdn_url = scriptcdn_main.urls.build
|
21
|
-
respond_to do |format|
|
22
|
-
format.html # new.html.erb
|
23
|
-
format.xml { render :xml => @scriptcdn_main }
|
24
|
-
end
|
25
21
|
end
|
26
22
|
|
27
23
|
# Edit Script URL
|
@@ -34,27 +30,19 @@ module Phcscriptcdnpro
|
|
34
30
|
def create
|
35
31
|
@scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
|
36
32
|
@scriptcdn_url = @scriptcdn_main.urls.create(scriptcdn_url_params)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
else
|
42
|
-
format.html { render action: 'new' }
|
43
|
-
format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity }
|
44
|
-
end
|
33
|
+
if @scriptcdn_url.save
|
34
|
+
redirect_to scriptcdn_main_urls_path, notice: 'Script URL was successfully created.'
|
35
|
+
else
|
36
|
+
render :new
|
45
37
|
end
|
46
38
|
end
|
47
39
|
|
48
40
|
# PATCH/PUT Script URL
|
49
41
|
def update
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
else
|
55
|
-
format.html { render action: 'edit' }
|
56
|
-
format.json { render json: @scriptcdn_url.errors, status: :unprocessable_entity }
|
57
|
-
end
|
42
|
+
if @scriptcdn_url.update(scriptcdn_url_params)
|
43
|
+
redirect_to scriptcdn_main_urls_path, notice: 'Script URL was successfully updated.'
|
44
|
+
else
|
45
|
+
render :edit
|
58
46
|
end
|
59
47
|
end
|
60
48
|
|
@@ -63,10 +51,7 @@ module Phcscriptcdnpro
|
|
63
51
|
@scriptcdn_main = Scriptcdn::Main.find(params[:main_id])
|
64
52
|
@scriptcdn_url = @scriptcdn_main.urls.find(params[:id])
|
65
53
|
@scriptcdn_url.destroy
|
66
|
-
|
67
|
-
format.html { redirect_to scriptcdn_main_urls_path, notice: 'Script URL was Successfully Deleted.' }
|
68
|
-
format.json { head :no_content }
|
69
|
-
end
|
54
|
+
redirect_to scriptcdn_main_urls_path, notice: 'Script url was successfully destroyed.'
|
70
55
|
end
|
71
56
|
|
72
57
|
private
|