next_sges 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/next_sges_manifest.js +2 -0
  6. data/app/assets/javascripts/next_sges/administrators.js +2 -0
  7. data/app/assets/javascripts/next_sges/application.js +13 -0
  8. data/app/assets/javascripts/next_sges/collection_note_items.js +2 -0
  9. data/app/assets/javascripts/next_sges/collection_notes.js +2 -0
  10. data/app/assets/javascripts/next_sges/collection_types.js +2 -0
  11. data/app/assets/javascripts/next_sges/deposits.js +2 -0
  12. data/app/assets/javascripts/next_sges/inscriptions.js +2 -0
  13. data/app/assets/javascripts/next_sges/parents.js +2 -0
  14. data/app/assets/javascripts/next_sges/responsible_others.js +2 -0
  15. data/app/assets/javascripts/next_sges/school_admins.js +2 -0
  16. data/app/assets/javascripts/next_sges/schools.js +2 -0
  17. data/app/assets/javascripts/next_sges/students.js +2 -0
  18. data/app/assets/stylesheets/next_sges/administrators.css +4 -0
  19. data/app/assets/stylesheets/next_sges/application.css +15 -0
  20. data/app/assets/stylesheets/next_sges/collection_note_items.css +4 -0
  21. data/app/assets/stylesheets/next_sges/collection_notes.css +4 -0
  22. data/app/assets/stylesheets/next_sges/collection_types.css +4 -0
  23. data/app/assets/stylesheets/next_sges/deposits.css +4 -0
  24. data/app/assets/stylesheets/next_sges/inscriptions.css +4 -0
  25. data/app/assets/stylesheets/next_sges/parents.css +4 -0
  26. data/app/assets/stylesheets/next_sges/responsible_others.css +4 -0
  27. data/app/assets/stylesheets/next_sges/school_admins.css +4 -0
  28. data/app/assets/stylesheets/next_sges/schools.css +4 -0
  29. data/app/assets/stylesheets/next_sges/students.css +4 -0
  30. data/app/assets/stylesheets/scaffold.css +80 -0
  31. data/app/controllers/next_sges/administrators_controller.rb +62 -0
  32. data/app/controllers/next_sges/application_controller.rb +5 -0
  33. data/app/controllers/next_sges/collection_note_items_controller.rb +62 -0
  34. data/app/controllers/next_sges/collection_notes_controller.rb +62 -0
  35. data/app/controllers/next_sges/collection_types_controller.rb +62 -0
  36. data/app/controllers/next_sges/deposits_controller.rb +62 -0
  37. data/app/controllers/next_sges/inscriptions_controller.rb +62 -0
  38. data/app/controllers/next_sges/parents_controller.rb +62 -0
  39. data/app/controllers/next_sges/responsible_others_controller.rb +62 -0
  40. data/app/controllers/next_sges/school_admins_controller.rb +62 -0
  41. data/app/controllers/next_sges/schools_controller.rb +62 -0
  42. data/app/controllers/next_sges/students_controller.rb +62 -0
  43. data/app/helpers/next_sges/administrators_helper.rb +4 -0
  44. data/app/helpers/next_sges/application_helper.rb +4 -0
  45. data/app/helpers/next_sges/collection_note_items_helper.rb +4 -0
  46. data/app/helpers/next_sges/collection_notes_helper.rb +4 -0
  47. data/app/helpers/next_sges/collection_types_helper.rb +4 -0
  48. data/app/helpers/next_sges/deposits_helper.rb +4 -0
  49. data/app/helpers/next_sges/inscriptions_helper.rb +4 -0
  50. data/app/helpers/next_sges/parents_helper.rb +4 -0
  51. data/app/helpers/next_sges/responsible_others_helper.rb +4 -0
  52. data/app/helpers/next_sges/school_admins_helper.rb +4 -0
  53. data/app/helpers/next_sges/schools_helper.rb +4 -0
  54. data/app/helpers/next_sges/students_helper.rb +4 -0
  55. data/app/jobs/next_sges/application_job.rb +4 -0
  56. data/app/mailers/next_sges/application_mailer.rb +6 -0
  57. data/app/models/next_sges/administrator.rb +19 -0
  58. data/app/models/next_sges/application_record.rb +33 -0
  59. data/app/models/next_sges/collection_note.rb +68 -0
  60. data/app/models/next_sges/collection_note_item.rb +173 -0
  61. data/app/models/next_sges/collection_type.rb +36 -0
  62. data/app/models/next_sges/deposit.rb +31 -0
  63. data/app/models/next_sges/inscription.rb +5 -0
  64. data/app/models/next_sges/parent.rb +37 -0
  65. data/app/models/next_sges/responsible_other.rb +20 -0
  66. data/app/models/next_sges/school.rb +21 -0
  67. data/app/models/next_sges/school_admin.rb +10 -0
  68. data/app/models/next_sges/student.rb +39 -0
  69. data/app/views/layouts/next_sges/application.html.erb +14 -0
  70. data/app/views/next_sges/administrators/_form.html.erb +27 -0
  71. data/app/views/next_sges/administrators/edit.html.erb +6 -0
  72. data/app/views/next_sges/administrators/index.html.erb +29 -0
  73. data/app/views/next_sges/administrators/new.html.erb +5 -0
  74. data/app/views/next_sges/administrators/show.html.erb +14 -0
  75. data/app/views/next_sges/collection_note_items/_form.html.erb +107 -0
  76. data/app/views/next_sges/collection_note_items/edit.html.erb +6 -0
  77. data/app/views/next_sges/collection_note_items/index.html.erb +61 -0
  78. data/app/views/next_sges/collection_note_items/new.html.erb +5 -0
  79. data/app/views/next_sges/collection_note_items/show.html.erb +94 -0
  80. data/app/views/next_sges/collection_notes/_form.html.erb +37 -0
  81. data/app/views/next_sges/collection_notes/edit.html.erb +6 -0
  82. data/app/views/next_sges/collection_notes/index.html.erb +33 -0
  83. data/app/views/next_sges/collection_notes/new.html.erb +5 -0
  84. data/app/views/next_sges/collection_notes/show.html.erb +24 -0
  85. data/app/views/next_sges/collection_types/_form.html.erb +37 -0
  86. data/app/views/next_sges/collection_types/edit.html.erb +6 -0
  87. data/app/views/next_sges/collection_types/index.html.erb +33 -0
  88. data/app/views/next_sges/collection_types/new.html.erb +5 -0
  89. data/app/views/next_sges/collection_types/show.html.erb +24 -0
  90. data/app/views/next_sges/deposits/_form.html.erb +37 -0
  91. data/app/views/next_sges/deposits/edit.html.erb +6 -0
  92. data/app/views/next_sges/deposits/index.html.erb +33 -0
  93. data/app/views/next_sges/deposits/new.html.erb +5 -0
  94. data/app/views/next_sges/deposits/show.html.erb +24 -0
  95. data/app/views/next_sges/inscriptions/_form.html.erb +102 -0
  96. data/app/views/next_sges/inscriptions/edit.html.erb +6 -0
  97. data/app/views/next_sges/inscriptions/index.html.erb +59 -0
  98. data/app/views/next_sges/inscriptions/new.html.erb +5 -0
  99. data/app/views/next_sges/inscriptions/show.html.erb +89 -0
  100. data/app/views/next_sges/parents/_form.html.erb +42 -0
  101. data/app/views/next_sges/parents/edit.html.erb +6 -0
  102. data/app/views/next_sges/parents/index.html.erb +35 -0
  103. data/app/views/next_sges/parents/new.html.erb +5 -0
  104. data/app/views/next_sges/parents/show.html.erb +29 -0
  105. data/app/views/next_sges/responsible_others/_form.html.erb +97 -0
  106. data/app/views/next_sges/responsible_others/edit.html.erb +6 -0
  107. data/app/views/next_sges/responsible_others/index.html.erb +57 -0
  108. data/app/views/next_sges/responsible_others/new.html.erb +5 -0
  109. data/app/views/next_sges/responsible_others/show.html.erb +84 -0
  110. data/app/views/next_sges/school_admins/_form.html.erb +32 -0
  111. data/app/views/next_sges/school_admins/edit.html.erb +6 -0
  112. data/app/views/next_sges/school_admins/index.html.erb +31 -0
  113. data/app/views/next_sges/school_admins/new.html.erb +5 -0
  114. data/app/views/next_sges/school_admins/show.html.erb +19 -0
  115. data/app/views/next_sges/schools/_form.html.erb +62 -0
  116. data/app/views/next_sges/schools/edit.html.erb +6 -0
  117. data/app/views/next_sges/schools/index.html.erb +43 -0
  118. data/app/views/next_sges/schools/new.html.erb +5 -0
  119. data/app/views/next_sges/schools/show.html.erb +49 -0
  120. data/app/views/next_sges/students/_form.html.erb +42 -0
  121. data/app/views/next_sges/students/edit.html.erb +6 -0
  122. data/app/views/next_sges/students/index.html.erb +35 -0
  123. data/app/views/next_sges/students/new.html.erb +5 -0
  124. data/app/views/next_sges/students/show.html.erb +29 -0
  125. data/config/routes.rb +13 -0
  126. data/db/migrate/20171209090042_create_next_sges_schools.rb +17 -0
  127. data/db/migrate/20171209093554_create_next_sges_parents.rb +17 -0
  128. data/db/migrate/20171209093716_create_next_sges_collection_types.rb +13 -0
  129. data/db/migrate/20171209095546_create_next_sges_students.rb +17 -0
  130. data/db/migrate/20171209100114_create_next_sges_collection_notes.rb +14 -0
  131. data/db/migrate/20171209104046_create_next_sges_deposits.rb +13 -0
  132. data/db/migrate/20171209110844_create_next_sges_administrators.rb +10 -0
  133. data/db/migrate/20171209111036_create_next_sges_school_admins.rb +12 -0
  134. data/db/migrate/20171209213002_create_next_sges_inscriptions.rb +25 -0
  135. data/db/migrate/20171209213302_create_join_table_inscription_collection_type.rb +8 -0
  136. data/db/migrate/20171211132659_create_join_table_student_collection_type.rb +8 -0
  137. data/db/migrate/20171211140033_add_value_to_collection_types.rb +5 -0
  138. data/db/migrate/20171213141321_create_next_sges_collection_note_items.rb +26 -0
  139. data/db/migrate/20171213160012_add_discount_ad_fine_to_collection_type.rb +13 -0
  140. data/db/migrate/20171214154917_rename_anual_payment_discount_from_next_sges_collection_types.rb +5 -0
  141. data/db/migrate/20171214204406_add_account_balance_to_next_sges_parents.rb +17 -0
  142. data/db/migrate/20171215120306_remove_student_from_deposit.rb +6 -0
  143. data/db/migrate/20171215133634_add_type_to_next_sges_deposits.rb +5 -0
  144. data/db/migrate/20171215144509_add_documents_to_next_sgad_parents.rb +6 -0
  145. data/db/migrate/20171215175025_add_avatar_to_next_sges_schools.rb +5 -0
  146. data/db/migrate/20171218082424_add_nif_to_next_sges_schools.rb +11 -0
  147. data/db/migrate/20171221224739_create_next_sges_responsible_others.rb +24 -0
  148. data/db/migrate/20171227221731_add_birthday_to_next_sgad_students.rb +7 -0
  149. data/db/migrate/20180216140129_add_collection_note_to_deposits.rb +5 -0
  150. data/lib/next_sges.rb +5 -0
  151. data/lib/next_sges/engine.rb +5 -0
  152. data/lib/next_sges/version.rb +3 -0
  153. data/lib/tasks/next_sges_tasks.rake +4 -0
  154. metadata +224 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 86b289d3391a1d806ce921a289cc045a4a6a3796
4
+ data.tar.gz: 6acb408675fbbf5e2e03223f781719efaa8cc576
5
+ SHA512:
6
+ metadata.gz: 7e468fe097229e89b77b4e74f12bcf13de14f4600c7c26ce3eb8615f3faf2126688f4ae3fca3c229a10a798e795d48af5cd152a8884adb18a160780395f9bc9c
7
+ data.tar.gz: 0ccc065559313be97ae97b85ef758c78e9c630056438ba75906ae459b69e6be31fa4b8076a664b8ca5bfde0cd1f87222fe9ef2c04ffecf224b7a4861736d16c5
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Ilton Flora Ingui
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 ADDED
@@ -0,0 +1,28 @@
1
+ # NextSges
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'next_sges'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install next_sges
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'NextSges'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ require 'bundler/gem_tasks'
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'test'
31
+ t.pattern = 'test/**/*_test.rb'
32
+ t.verbose = false
33
+ end
34
+
35
+
36
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/next_sges .js
2
+ //= link_directory ../stylesheets/next_sges .css
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,80 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ margin: 33px;
5
+ }
6
+
7
+ body, p, ol, ul, td {
8
+ font-family: verdana, arial, helvetica, sans-serif;
9
+ font-size: 13px;
10
+ line-height: 18px;
11
+ }
12
+
13
+ pre {
14
+ background-color: #eee;
15
+ padding: 10px;
16
+ font-size: 11px;
17
+ }
18
+
19
+ a {
20
+ color: #000;
21
+ }
22
+
23
+ a:visited {
24
+ color: #666;
25
+ }
26
+
27
+ a:hover {
28
+ color: #fff;
29
+ background-color: #000;
30
+ }
31
+
32
+ th {
33
+ padding-bottom: 5px;
34
+ }
35
+
36
+ td {
37
+ padding: 0 5px 7px;
38
+ }
39
+
40
+ div.field,
41
+ div.actions {
42
+ margin-bottom: 10px;
43
+ }
44
+
45
+ #notice {
46
+ color: green;
47
+ }
48
+
49
+ .field_with_errors {
50
+ padding: 2px;
51
+ background-color: red;
52
+ display: table;
53
+ }
54
+
55
+ #error_explanation {
56
+ width: 450px;
57
+ border: 2px solid red;
58
+ padding: 7px 7px 0;
59
+ margin-bottom: 20px;
60
+ background-color: #f0f0f0;
61
+ }
62
+
63
+ #error_explanation h2 {
64
+ text-align: left;
65
+ font-weight: bold;
66
+ padding: 5px 5px 5px 15px;
67
+ font-size: 12px;
68
+ margin: -7px -7px 0;
69
+ background-color: #c00;
70
+ color: #fff;
71
+ }
72
+
73
+ #error_explanation ul li {
74
+ font-size: 12px;
75
+ list-style: square;
76
+ }
77
+
78
+ label {
79
+ display: block;
80
+ }
@@ -0,0 +1,62 @@
1
+ require_dependency "next_sges/application_controller"
2
+
3
+ module NextSges
4
+ class AdministratorsController < ::ApplicationController
5
+ before_action :set_administrator, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /administrators
8
+ def index
9
+ @administrators = Administrator.all
10
+ end
11
+
12
+ # GET /administrators/1
13
+ def show
14
+ end
15
+
16
+ # GET /administrators/new
17
+ def new
18
+ @administrator = Administrator.new
19
+ end
20
+
21
+ # GET /administrators/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /administrators
26
+ def create
27
+ @administrator = Administrator.new(administrator_params)
28
+
29
+ if @administrator.save
30
+ redirect_to @administrator, notice: 'Administrator was successfully created.'
31
+ else
32
+ render :new
33
+ end
34
+ end
35
+
36
+ # PATCH/PUT /administrators/1
37
+ def update
38
+ if @administrator.update(administrator_params)
39
+ redirect_to @administrator, notice: 'Administrator was successfully updated.'
40
+ else
41
+ render :edit
42
+ end
43
+ end
44
+
45
+ # DELETE /administrators/1
46
+ def destroy
47
+ @administrator.destroy
48
+ redirect_to administrators_url, notice: 'Administrator was successfully destroyed.'
49
+ end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_administrator
54
+ @administrator = Administrator.find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def administrator_params
59
+ params.require(:administrator).permit(:number, :user_id, :user_type)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,5 @@
1
+ module NextSges
2
+ class ApplicationController < ::ApplicationController
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,62 @@
1
+ require_dependency "next_sges/application_controller"
2
+
3
+ module NextSges
4
+ class CollectionNoteItemsController < ApplicationController
5
+ before_action :set_collection_note_item, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /collection_note_items
8
+ def index
9
+ @collection_note_items = CollectionNoteItem.all
10
+ end
11
+
12
+ # GET /collection_note_items/1
13
+ def show
14
+ end
15
+
16
+ # GET /collection_note_items/new
17
+ def new
18
+ @collection_note_item = CollectionNoteItem.new
19
+ end
20
+
21
+ # GET /collection_note_items/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /collection_note_items
26
+ def create
27
+ @collection_note_item = CollectionNoteItem.new(collection_note_item_params)
28
+
29
+ if @collection_note_item.save
30
+ redirect_to @collection_note_item, notice: 'Collection note item was successfully created.'
31
+ else
32
+ render :new
33
+ end
34
+ end
35
+
36
+ # PATCH/PUT /collection_note_items/1
37
+ def update
38
+ if @collection_note_item.update(collection_note_item_params)
39
+ redirect_to @collection_note_item, notice: 'Collection note item was successfully updated.'
40
+ else
41
+ render :edit
42
+ end
43
+ end
44
+
45
+ # DELETE /collection_note_items/1
46
+ def destroy
47
+ @collection_note_item.destroy
48
+ redirect_to collection_note_items_url, notice: 'Collection note item was successfully destroyed.'
49
+ end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_collection_note_item
54
+ @collection_note_item = CollectionNoteItem.find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def collection_note_item_params
59
+ params.require(:collection_note_item).permit(:name, :description, :base_value, :value, :quantity, :collection_note_id, :date, :collection_type_id, :discount_description, :discount_percentage, :discount_value, :student_id, :fine_description, :fine_percentage, :fine_value, :collection_type_frequency, :collection_type_category, :school_id)
60
+ end
61
+ end
62
+ end