phcscriptcdn 7.0.0 → 7.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +43 -43
  4. data/Rakefile +33 -33
  5. data/app/assets/config/phcscriptcdn_manifest.js +2 -2
  6. data/app/assets/javascripts/phcscriptcdn/application.js +2 -2
  7. data/app/assets/stylesheets/phcscriptcdn/application.scss +2 -2
  8. data/app/controllers/phcscriptcdn/application_controller.rb +12 -12
  9. data/app/controllers/phcscriptcdn/script/authors_controller.rb +65 -65
  10. data/app/controllers/phcscriptcdn/script/extensions_controller.rb +65 -65
  11. data/app/controllers/phcscriptcdn/script/licences_controller.rb +65 -65
  12. data/app/controllers/phcscriptcdn/script/listings_controller.rb +65 -65
  13. data/app/controllers/phcscriptcdn/script/urls_controller.rb +74 -74
  14. data/app/controllers/phcscriptcdn/script/versions_controller.rb +65 -65
  15. data/app/helpers/phcscriptcdn/application_helper.rb +14 -14
  16. data/app/jobs/phcscriptcdn/application_job.rb +4 -4
  17. data/app/models/phcscriptcdn/application_record.rb +4 -4
  18. data/app/models/phcscriptcdn/script.rb +6 -6
  19. data/app/models/phcscriptcdn/script/author.rb +20 -20
  20. data/app/models/phcscriptcdn/script/extension.rb +24 -24
  21. data/app/models/phcscriptcdn/script/licence.rb +23 -23
  22. data/app/models/phcscriptcdn/script/listing.rb +32 -32
  23. data/app/models/phcscriptcdn/script/url.rb +26 -26
  24. data/app/models/phcscriptcdn/script/version.rb +20 -20
  25. data/app/views/layouts/phcscriptcdn/application.html.erb +56 -56
  26. data/app/views/layouts/phcscriptcdn/components/backend/footer/_footer.html.erb +4 -4
  27. data/app/views/layouts/phcscriptcdn/components/backend/navigation/_navigation.html.erb +56 -56
  28. data/app/views/layouts/phcscriptcdn/components/backend/topbar/_topbar.html.erb +5 -5
  29. data/app/views/layouts/phcscriptcdn/components/backend/topbar/_topbar_links.html.erb +0 -0
  30. data/app/views/layouts/phcscriptcdn/frontend.html.erb +22 -22
  31. data/app/views/phcscriptcdn/script/authors/_form.html.erb +36 -36
  32. data/app/views/phcscriptcdn/script/authors/edit.html.erb +39 -39
  33. data/app/views/phcscriptcdn/script/authors/index.html.erb +67 -67
  34. data/app/views/phcscriptcdn/script/authors/new.html.erb +39 -39
  35. data/app/views/phcscriptcdn/script/authors/show.html.erb +42 -42
  36. data/app/views/phcscriptcdn/script/extensions/_form.html.erb +28 -28
  37. data/app/views/phcscriptcdn/script/extensions/edit.html.erb +39 -39
  38. data/app/views/phcscriptcdn/script/extensions/index.html.erb +61 -61
  39. data/app/views/phcscriptcdn/script/extensions/new.html.erb +38 -38
  40. data/app/views/phcscriptcdn/script/extensions/show.html.erb +42 -42
  41. data/app/views/phcscriptcdn/script/licences/_form.html.erb +47 -47
  42. data/app/views/phcscriptcdn/script/licences/edit.html.erb +39 -39
  43. data/app/views/phcscriptcdn/script/licences/index.html.erb +71 -71
  44. data/app/views/phcscriptcdn/script/licences/new.html.erb +39 -39
  45. data/app/views/phcscriptcdn/script/licences/show.html.erb +42 -42
  46. data/app/views/phcscriptcdn/script/listings/_form.html.erb +68 -68
  47. data/app/views/phcscriptcdn/script/listings/edit.html.erb +39 -39
  48. data/app/views/phcscriptcdn/script/listings/index.html.erb +65 -65
  49. data/app/views/phcscriptcdn/script/listings/new.html.erb +39 -39
  50. data/app/views/phcscriptcdn/script/listings/show.html.erb +40 -40
  51. data/app/views/phcscriptcdn/script/urls/_form.html.erb +36 -36
  52. data/app/views/phcscriptcdn/script/urls/edit.html.erb +39 -39
  53. data/app/views/phcscriptcdn/script/urls/index.html.erb +63 -63
  54. data/app/views/phcscriptcdn/script/urls/new.html.erb +39 -39
  55. data/app/views/phcscriptcdn/script/urls/show.html.erb +41 -41
  56. data/app/views/phcscriptcdn/script/versions/_form.html.erb +20 -20
  57. data/app/views/phcscriptcdn/script/versions/edit.html.erb +39 -39
  58. data/app/views/phcscriptcdn/script/versions/index.html.erb +59 -59
  59. data/app/views/phcscriptcdn/script/versions/new.html.erb +39 -39
  60. data/app/views/phcscriptcdn/script/versions/show.html.erb +42 -42
  61. data/config/initializers/friendly_id.rb +92 -92
  62. data/config/routes.rb +30 -30
  63. data/db/migrate/20160731205205_create_phcscriptcdn_script_extensions.rb +20 -20
  64. data/db/migrate/20160731205917_create_phcscriptcdn_script_listings.rb +35 -35
  65. data/db/migrate/20160731205954_create_phcscriptcdn_script_versions.rb +18 -18
  66. data/db/migrate/20160731210626_create_phcscriptcdn_script_urls.rb +24 -24
  67. data/db/migrate/20160731210723_create_phcscriptcdn_script_authors.rb +23 -23
  68. data/db/migrate/20160801032225_create_phcscriptcdn_script_licences.rb +27 -27
  69. data/db/migrate/20170423022446_create_friendly_id_slugs.rb +15 -15
  70. data/lib/phcscriptcdn.rb +4 -4
  71. data/lib/phcscriptcdn/engine.rb +68 -68
  72. data/lib/phcscriptcdn/version.rb +3 -3
  73. data/lib/tasks/phcscriptcdn_tasks.rake +4 -4
  74. metadata +47 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 219c01dd8025c8b88422b97b12d0354270f5c4a0
4
- data.tar.gz: c71c6df2f93e784b90235cf456c82bec48f9ead7
3
+ metadata.gz: 7e6d782f70ded1858eacf64ff8a642bcf0ec766b
4
+ data.tar.gz: fa3d3df5f9956d8fcb73641cb1910006afa0630b
5
5
  SHA512:
6
- metadata.gz: 0fe5bcb780bedc0f1614260d504a18f0b7c32d57e3b526697f3c6a748ee98b53e4396da71d2c167af3736c0af2270b586d73062adb981a65579d312523c1f08e
7
- data.tar.gz: 9abd460578a63e794fc1f1992b44c356474c78ffce3398e0f0659c531b3cae0711afa90a73a4109c79b44731973bfc985cef104685d6e3ed28e11d8662869208
6
+ metadata.gz: d738e6de08d54d787d5afa88e1943fb23569cdbb170d6feba7a0291ff3049d7f43a5bdf23bd4f4be584e7b486d7b459508bea44e73cdaf5b5ff4d84ff1a94de9
7
+ data.tar.gz: 308b14a527351420dea98839cd551cabfc78332811f14d6601c4ebd48b58748ee66c7f13ac4559fc29844e194cf544118a77a7ffe3c8e2474001e01518f94208
data/MIT-LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright 2016-2017 BradPotts - PHCNetworks
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright 2016-2017 BradPotts - PHCNetworks
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,43 +1,43 @@
1
- [![security](https://hakiri.io/github/PHCNetworks/phc-scriptcdn/master.svg)](https://hakiri.io/github/PHCNetworks/phc-scriptcdn/master)
2
- [![Code Climate](https://codeclimate.com/github/PHCNetworks/phc-scrtipcdn/badges/gpa.svg)](https://codeclimate.com/github/PHCNetworks/phc-scrtipcdn)
3
- [![Dependency Status](https://gemnasium.com/badges/github.com/PHCNetworks/phc-scriptcdn.svg)](https://gemnasium.com/github.com/PHCNetworks/phc-scriptcdn)
4
- [![Gem Version](https://badge.fury.io/rb/phcscriptcdn.svg)](https://badge.fury.io/rb/phcscriptcdn)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/PHCNetworks/phc-scriptcdn/blob/master/MIT-LICENSE)
6
-
7
- ### PHCScriptCDN(6) (Script Listing Engine) Documentation
8
- PHCScriptCDN(6) rails script management engine for website script CDN listings.
9
-
10
- * Manage script CDN listings for websites.
11
- * Main script title and description.
12
- * Script versions and script URLs.
13
-
14
- #### Step 1 - Add PHCScriptCDN to your gemfile and run command
15
-
16
- gem 'phcscriptcdn', '~> 6.0'
17
- bundle install
18
-
19
- #### Step 2 - Copy PHCScriptCDN Database Tables
20
- To copy PHCScriptCDN's required database migrations, copy each command individually to your terminal's command line.
21
-
22
- rails phcscriptcdn:install:migrations
23
- rails db:migrate
24
-
25
- #### Step 3 - Mount PHCScriptCDN & Add Routes
26
- Mount PHCMembers by adding code below to your routes file.
27
-
28
- mount Phcscriptcdn::Engine, :at => '/'
29
-
30
- #### Step 4 - Recompile Assets
31
- To properly function re-compile your application's assets to copy over required files.
32
-
33
- rails assets:clobber
34
- rails assets:precompile
35
-
36
- #### Step 5 - Generate Contact Form View (Customization)
37
- All PHCScriptCDN views and layouts can be overwritten by copying files to your application.
38
-
39
- rails generate phcscriptcdn:views
40
-
41
- #### Additional Information
42
-
43
- - [Critical Security Updates](https://github.com/PHCNetworks/phc-scriptcdn/wiki/Critical-Security-Updates)
1
+ [![security](https://hakiri.io/github/PHCNetworks/phc-scriptcdn/master.svg)](https://hakiri.io/github/PHCNetworks/phc-scriptcdn/master)
2
+ [![Code Climate](https://codeclimate.com/github/PHCNetworks/phc-scrtipcdn/badges/gpa.svg)](https://codeclimate.com/github/PHCNetworks/phc-scrtipcdn)
3
+ [![Dependency Status](https://gemnasium.com/badges/github.com/PHCNetworks/phc-scriptcdn.svg)](https://gemnasium.com/github.com/PHCNetworks/phc-scriptcdn)
4
+ [![Gem Version](https://badge.fury.io/rb/phcscriptcdn.svg)](https://badge.fury.io/rb/phcscriptcdn)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/PHCNetworks/phc-scriptcdn/blob/master/MIT-LICENSE)
6
+
7
+ ### PHCScriptCDN(6) (Script Listing Engine) Documentation
8
+ PHCScriptCDN(6) rails script management engine for website script CDN listings.
9
+
10
+ * Manage script CDN listings for websites.
11
+ * Main script title and description.
12
+ * Script versions and script URLs.
13
+
14
+ #### Step 1 - Add PHCScriptCDN to your gemfile and run command
15
+
16
+ gem 'phcscriptcdn', '~> 6.0'
17
+ bundle install
18
+
19
+ #### Step 2 - Copy PHCScriptCDN Database Tables
20
+ To copy PHCScriptCDN's required database migrations, copy each command individually to your terminal's command line.
21
+
22
+ rails phcscriptcdn:install:migrations
23
+ rails db:migrate
24
+
25
+ #### Step 3 - Mount PHCScriptCDN & Add Routes
26
+ Mount PHCMembers by adding code below to your routes file.
27
+
28
+ mount Phcscriptcdn::Engine, :at => '/'
29
+
30
+ #### Step 4 - Recompile Assets
31
+ To properly function re-compile your application's assets to copy over required files.
32
+
33
+ rails assets:clobber
34
+ rails assets:precompile
35
+
36
+ #### Step 5 - Generate Contact Form View (Customization)
37
+ All PHCScriptCDN views and layouts can be overwritten by copying files to your application.
38
+
39
+ rails generate phcscriptcdn:views
40
+
41
+ #### Additional Information
42
+
43
+ - [Critical Security Updates](https://github.com/PHCNetworks/phc-scriptcdn/wiki/Critical-Security-Updates)
data/Rakefile CHANGED
@@ -1,33 +1,33 @@
1
- begin
2
- require 'bundler/setup'
3
-
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
7
-
8
- require 'rdoc/task'
9
-
10
- RDoc::Task.new(:rdoc) do |rdoc|
11
- rdoc.rdoc_dir = 'rdoc'
12
- rdoc.title = 'Phcscriptcdn'
13
- rdoc.options << '--line-numbers'
14
- rdoc.rdoc_files.include('README.md')
15
- rdoc.rdoc_files.include('lib/**/*.rb')
16
- end
17
-
18
- APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
19
-
20
- load 'rails/tasks/engine.rake'
21
- load 'rails/tasks/statistics.rake'
22
-
23
- require 'bundler/gem_tasks'
24
- require 'rake/testtask'
25
-
26
- Rake::TestTask.new(:test) do |t|
27
- t.libs << 'lib'
28
- t.libs << 'test'
29
- t.pattern = 'test/**/*_test.rb'
30
- t.verbose = false
31
- end
32
-
33
- task default: :test
1
+ begin
2
+ require 'bundler/setup'
3
+
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ require 'rdoc/task'
9
+
10
+ RDoc::Task.new(:rdoc) do |rdoc|
11
+ rdoc.rdoc_dir = 'rdoc'
12
+ rdoc.title = 'Phcscriptcdn'
13
+ rdoc.options << '--line-numbers'
14
+ rdoc.rdoc_files.include('README.md')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
16
+ end
17
+
18
+ APP_RAKEFILE = File.expand_path("../spec/testapp/Rakefile", __FILE__)
19
+
20
+ load 'rails/tasks/engine.rake'
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+ require 'bundler/gem_tasks'
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+ task default: :test
@@ -1,2 +1,2 @@
1
- //= link_directory ../javascripts/phcscriptcdn .js
2
- //= link_directory ../stylesheets/phcscriptcdn .scss
1
+ //= link_directory ../javascripts/phcscriptcdn .js
2
+ //= link_directory ../stylesheets/phcscriptcdn .scss
@@ -1,2 +1,2 @@
1
- // Load PHCAdmin3 Javascript
2
- //= require phc_admins_main_three
1
+ // Load PHCAdmin3 Javascript
2
+ //= require phc_admins_main_three
@@ -1,2 +1,2 @@
1
- // Load PHCAdmin3 Styles
2
- @import "phc_admins_style_three";
1
+ // Load PHCAdmin3 Styles
2
+ @import "phc_admins_style_three";
@@ -1,12 +1,12 @@
1
- module Phcscriptcdn
2
- class ApplicationController < ActionController::Base
3
-
4
- # Security
5
- protect_from_forgery with: :exception
6
-
7
- # Load Helpers
8
- helper Phctitleseo::Engine.helpers
9
- helper Phcnotifi::Engine.helpers
10
-
11
- end
12
- end
1
+ module Phcscriptcdn
2
+ class ApplicationController < ActionController::Base
3
+
4
+ # Security
5
+ protect_from_forgery with: :exception
6
+
7
+ # Load Helpers
8
+ helper Phctitleseo::Engine.helpers
9
+ helper Phcnotifi::Engine.helpers
10
+
11
+ end
12
+ end
@@ -1,65 +1,65 @@
1
- require_dependency "phcscriptcdn/application_controller"
2
-
3
- module Phcscriptcdn
4
- class Script::AuthorsController < ApplicationController
5
-
6
- # Filters & Security
7
- before_action :set_script_author, only: [:show, :edit, :update, :destroy]
8
-
9
- # INDEX - Script Author
10
- def index
11
- @script_authors = Script::Author.all
12
- end
13
-
14
- # DETAILS - Script Author
15
- def show
16
- end
17
-
18
- # NEW - Script Author
19
- def new
20
- @script_author = Script::Author.new
21
- end
22
-
23
- # EDIT - Script Author
24
- def edit
25
- end
26
-
27
- # CREATE - Script Author
28
- def create
29
- @script_author = Script::Author.new(script_author_params)
30
- if @script_author.save
31
- redirect_to script_authors_url, notice: 'Author was successfully created.'
32
- else
33
- render :new
34
- end
35
- end
36
-
37
- # PATCH/PUT - Script Author
38
- def update
39
- if @script_author.update(script_author_params)
40
- redirect_to script_authors_url, notice: 'Author was successfully updated.'
41
- else
42
- render :edit
43
- end
44
- end
45
-
46
- # DELETE - Script Author
47
- def destroy
48
- @script_author.destroy
49
- redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
50
- end
51
-
52
- private
53
-
54
- # Common Callbacks
55
- def set_script_author
56
- @script_author = Script::Author.find(params[:id])
57
- end
58
-
59
- # Whitelist
60
- def script_author_params
61
- params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :user_id, :user_name)
62
- end
63
-
64
- end
65
- end
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::AuthorsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_author, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Author
10
+ def index
11
+ @script_authors = Script::Author.all
12
+ end
13
+
14
+ # DETAILS - Script Author
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Author
19
+ def new
20
+ @script_author = Script::Author.new
21
+ end
22
+
23
+ # EDIT - Script Author
24
+ def edit
25
+ end
26
+
27
+ # CREATE - Script Author
28
+ def create
29
+ @script_author = Script::Author.new(script_author_params)
30
+ if @script_author.save
31
+ redirect_to script_authors_url, notice: 'Author was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Author
38
+ def update
39
+ if @script_author.update(script_author_params)
40
+ redirect_to script_authors_url, notice: 'Author was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Author
47
+ def destroy
48
+ @script_author.destroy
49
+ redirect_to script_authors_url, notice: 'Author was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_author
56
+ @script_author = Script::Author.find(params[:id])
57
+ end
58
+
59
+ # Whitelist
60
+ def script_author_params
61
+ params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :user_id, :user_name)
62
+ end
63
+
64
+ end
65
+ end
@@ -1,65 +1,65 @@
1
- require_dependency "phcscriptcdn/application_controller"
2
-
3
- module Phcscriptcdn
4
- class Script::ExtensionsController < ApplicationController
5
-
6
- # Filters & Security
7
- before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
8
-
9
- # INDEX - Script Extension
10
- def index
11
- @script_extensions = Script::Extension.all
12
- end
13
-
14
- # DETAILS - Script Extension
15
- def show
16
- end
17
-
18
- # NEW - Script Extension
19
- def new
20
- @script_extension = Script::Extension.new
21
- end
22
-
23
- # EDIT - Script Extension
24
- def edit
25
- end
26
-
27
- # CREATE - Script Extension
28
- def create
29
- @script_extension = Script::Extension.new(script_extension_params)
30
- if @script_extension.save
31
- redirect_to script_extensions_url, notice: 'Extension was successfully created.'
32
- else
33
- render :new
34
- end
35
- end
36
-
37
- # PATCH/PUT - Script Extension
38
- def update
39
- if @script_extension.update(script_extension_params)
40
- redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
41
- else
42
- render :edit
43
- end
44
- end
45
-
46
- # DELETE - Script Extension
47
- def destroy
48
- @script_extension.destroy
49
- redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
50
- end
51
-
52
- private
53
-
54
- # Common Callbacks
55
- def set_script_extension
56
- @script_extension = Script::Extension.find(params[:id])
57
- end
58
-
59
- # Whitelists
60
- def script_extension_params
61
- params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :user_id, :user_name)
62
- end
63
-
64
- end
65
- end
1
+ require_dependency "phcscriptcdn/application_controller"
2
+
3
+ module Phcscriptcdn
4
+ class Script::ExtensionsController < ApplicationController
5
+
6
+ # Filters & Security
7
+ before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
8
+
9
+ # INDEX - Script Extension
10
+ def index
11
+ @script_extensions = Script::Extension.all
12
+ end
13
+
14
+ # DETAILS - Script Extension
15
+ def show
16
+ end
17
+
18
+ # NEW - Script Extension
19
+ def new
20
+ @script_extension = Script::Extension.new
21
+ end
22
+
23
+ # EDIT - Script Extension
24
+ def edit
25
+ end
26
+
27
+ # CREATE - Script Extension
28
+ def create
29
+ @script_extension = Script::Extension.new(script_extension_params)
30
+ if @script_extension.save
31
+ redirect_to script_extensions_url, notice: 'Extension was successfully created.'
32
+ else
33
+ render :new
34
+ end
35
+ end
36
+
37
+ # PATCH/PUT - Script Extension
38
+ def update
39
+ if @script_extension.update(script_extension_params)
40
+ redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
41
+ else
42
+ render :edit
43
+ end
44
+ end
45
+
46
+ # DELETE - Script Extension
47
+ def destroy
48
+ @script_extension.destroy
49
+ redirect_to script_extensions_url, notice: 'Extension was successfully destroyed.'
50
+ end
51
+
52
+ private
53
+
54
+ # Common Callbacks
55
+ def set_script_extension
56
+ @script_extension = Script::Extension.find(params[:id])
57
+ end
58
+
59
+ # Whitelists
60
+ def script_extension_params
61
+ params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :user_id, :user_name)
62
+ end
63
+
64
+ end
65
+ end