user_stamp 3.0.2 → 4.0.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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +2 -2
  3. data/README.rdoc +3 -3
  4. data/Rakefile +6 -9
  5. data/config/routes.rb +22 -21
  6. data/lib/generators/user_stamp/USAGE +5 -6
  7. data/lib/generators/user_stamp/templates/user_stamp.template +16 -21
  8. data/lib/generators/user_stamp/user_stamp_generator.rb +23 -23
  9. data/lib/user_stamp.rb +23 -22
  10. data/lib/user_stamp/app_controller.rb +22 -24
  11. data/lib/user_stamp/config.rb +29 -33
  12. data/lib/user_stamp/engine.rb +27 -28
  13. data/lib/user_stamp/user.rb +23 -24
  14. data/lib/user_stamp/user_stamp.rb +33 -35
  15. data/lib/user_stamp/version.rb +23 -22
  16. data/test/dummy/README.rdoc +15 -248
  17. data/test/dummy/Rakefile +1 -2
  18. data/test/dummy/app/assets/javascripts/application.js +4 -6
  19. data/test/dummy/app/assets/stylesheets/application.css +6 -4
  20. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  21. data/test/dummy/app/controllers/application_controller.rb +5 -30
  22. data/test/dummy/app/controllers/materials_controller.rb +27 -51
  23. data/test/dummy/app/controllers/products_controller.rb +27 -51
  24. data/test/dummy/app/helpers/application_helper.rb +0 -26
  25. data/test/dummy/app/helpers/materials_helper.rb +0 -26
  26. data/test/dummy/app/helpers/products_helper.rb +0 -26
  27. data/test/dummy/app/models/material.rb +2 -33
  28. data/test/dummy/app/models/product.rb +3 -30
  29. data/test/dummy/app/models/user.rb +0 -30
  30. data/test/dummy/app/views/layouts/application.html.erb +2 -2
  31. data/test/dummy/app/views/materials/_form.html.erb +9 -9
  32. data/test/dummy/app/views/materials/edit.html.erb +2 -2
  33. data/test/dummy/app/views/materials/index.html.erb +27 -23
  34. data/test/dummy/app/views/materials/new.html.erb +1 -2
  35. data/test/dummy/app/views/materials/show.html.erb +4 -8
  36. data/test/dummy/app/views/products/_form.html.erb +6 -6
  37. data/test/dummy/app/views/products/edit.html.erb +1 -1
  38. data/test/dummy/app/views/products/index.html.erb +26 -22
  39. data/test/dummy/app/views/products/new.html.erb +1 -1
  40. data/test/dummy/app/views/products/show.html.erb +4 -5
  41. data/test/dummy/bin/bundle +3 -0
  42. data/test/dummy/bin/rails +4 -0
  43. data/test/dummy/bin/rake +4 -0
  44. data/test/dummy/bin/setup +29 -0
  45. data/test/dummy/config.ru +2 -2
  46. data/test/dummy/config/application.rb +2 -35
  47. data/test/dummy/config/boot.rb +4 -9
  48. data/test/dummy/config/database.yml +8 -8
  49. data/test/dummy/config/environment.rb +3 -3
  50. data/test/dummy/config/environments/development.rb +22 -18
  51. data/test/dummy/config/environments/production.rb +46 -34
  52. data/test/dummy/config/environments/test.rb +19 -14
  53. data/test/dummy/config/initializers/assets.rb +11 -0
  54. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  55. data/test/dummy/config/initializers/devise.rb +5 -5
  56. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  57. data/test/dummy/config/initializers/inflections.rb +6 -5
  58. data/test/dummy/config/initializers/mime_types.rb +0 -1
  59. data/test/dummy/config/initializers/session_store.rb +1 -6
  60. data/test/dummy/config/initializers/user_stamp.rb +16 -21
  61. data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
  62. data/test/dummy/config/locales/en.yml +20 -2
  63. data/test/dummy/config/routes.rb +56 -4
  64. data/test/dummy/config/secrets.yml +22 -0
  65. data/test/dummy/db/development.sqlite3 +0 -0
  66. data/test/dummy/db/migrate/{20150418012302_devise_create_users.rb → 20150427152452_devise_create_users.rb} +1 -1
  67. data/test/dummy/db/migrate/{20150420023321_create_materials.rb → 20150427153058_create_materials.rb} +2 -2
  68. data/test/dummy/db/migrate/{20150418013334_create_products.rb → 20150427153126_create_products.rb} +5 -5
  69. data/test/dummy/db/schema.rb +19 -19
  70. data/test/dummy/db/test.sqlite3 +0 -0
  71. data/test/dummy/public/404.html +54 -13
  72. data/test/dummy/public/422.html +54 -13
  73. data/test/dummy/public/500.html +53 -12
  74. data/test/dummy/test/{functional → controllers}/materials_controller_test.rb +6 -36
  75. data/test/dummy/test/{functional → controllers}/products_controller_test.rb +9 -39
  76. data/test/dummy/test/models/material_test.rb +7 -0
  77. data/test/dummy/test/models/product_test.rb +7 -0
  78. data/test/dummy/test/models/user_test.rb +7 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-uBri7P4oa8-cPDbuxBzrBh6f_6YgmRETeF1cPQ98BI.cache +2 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0HaE6Po_aJLoGCREH2pm0GVz0rQO2AnHYN5WxfxRAdk.cache +2 -0
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4WkO5ZKNyqFfwe0aMDO40zL7WuG01_LUMIo_Z1VIwIM.cache +2 -0
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6sjvyZUWlu55-3XP-5yZfxjfXvbrvxsg-E3Q7B_t8pk.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/8Z_hEjtyPSQN4opQbT6RkcCNBCF-CFQybzoSs5Aq6KI.cache +2 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9-HUlJkF3jRyupEtKfWn1dlmpPkguFR6iptppjOucgg.cache +1 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/A7WZdZGirgPer7eGsq2mJfHio6N9R9HJJxM4hkuItJo.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DzCB5KQSlVUBNf_tlBgnzTbS3b_pMkzkuqihSfNHe4s.cache +2 -0
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GIw-liLL0pp9xX_VtZkZToKgqPr4koaqbpG9bROGWQQ.cache +0 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IgADW9PKfRr6TSWEm1ipKSMaJ4DwdbJMYiKMXWP2qvw.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MEs_AIdrjZ9MYzLES9uOroxBGNjY9Stpe19ohy0z1lA.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/SDZR43ZDx01ZzCRNeIhjSx_9kJO78HCK8YMJAKnWIaI.cache +0 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/U2SInYmDs_pipNOzdogCHPXzyUyc1h5jAls6xbWSGs4.cache +1 -0
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UL1xczCpSxV6CONGlfaMEdE5KwKA9o56RLp2QZxGstA.cache +2 -0
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UReuCl2zv3Z3nGvte7lUGu7979JxkuCRbDNv6-HtTZU.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WT1n2kS2FLNKA6DHRX7THVlGIGzgTC8je4MMzBQtSmg.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XgTwbFt01e5bfNNba5Gr83GNRea9MoFlqP2rJGW_rjk.cache +0 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZAc9zFuIs2cKSfQZVtEkV3u4_RLFxLSP55C0RqqhZ1w.cache +2 -0
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Zea97tHycA5aXYbZ9DHtFHTu4bhAZcIhb0RlckVvzXI.cache +1 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZwP9zS5ft5ww816BPhmhQPqMPKbbgPdjBrz5VnSZ5oo.cache +2 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hwZcJkZ_YQ4hjBA1FzHIvGWudWHtQDZW7h8zUJslBQM.cache +1 -0
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iqtLgHvtAikgr0-aW1Vqy4KeUsVmzgOz9YVG2_2RVeY.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jpKzE4ZVMG4ynSLgDB76TOPEZbHNqYF8BQRy94ioeQE.cache +2 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kM0liVKuJ_BZI9HenUEa6OO9pOnT4KuC-zzXot34reU.cache +2 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nGfH8igMEHxuQWcDKD23EjWqmSvgxI2sVXhNOC5wE8I.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ni5fBgQoTXajLTgoWS8nd8LoiucG5krt3YIpbrx1mIY.cache +2 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oVvP3smTURXlapOzr_iUN4Ew_m3EEy3CQ4M0cOkTsm0.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oX6WZjQtAOkKXBohDgfcjs0cda8wFDGnkwJDGkJoytI.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oeTdUtI5qsh1Nn2Hy6_wmjtPV25O-RCQPcNjCwoSCKA.cache +0 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ov953wmqzp_9OaWCaoMLlOSWzHeF9kLApt4aCcW-Bgk.cache +1 -0
  109. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/sg6mpEMI9L65gEc7QFaXG534feyjIGE29SE7B_RTQNY.cache +1 -0
  110. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uJ8m6b9jypIn4pSuuaKkFBW9E2Ifcx2ulcERIa1q1dA.cache +1 -0
  111. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uYPgal6XAaVE9q7oz6jQS5nmQKM3IwZ8tnsE-__Oweo.cache +1 -0
  112. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vXJI-yUwt8d552Mj63nmnTx46YY7-GUrYuFzLUT9hMI.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xs2cSdXmo8vitmiaAo7fhDSGbrVPUKN17Ue3aTCUseE.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yCPG4xJ4TDzj7Mbcm2B0wDN_Jqlu2dKg8bFLKqW-pBI.cache +0 -0
  115. data/test/fixtures/materials.yml +1 -1
  116. data/test/fixtures/products.yml +1 -1
  117. data/test/fixtures/users.yml +5 -26
  118. data/test/test_helper.rb +7 -33
  119. data/test/user_stamp_test.rb +0 -26
  120. metadata +124 -40
  121. data/test/dummy/config/initializers/secret_token.rb +0 -7
  122. data/test/dummy/log/test.log +0 -414
  123. data/test/dummy/script/rails +0 -6
  124. data/test/dummy/test/unit/helpers/materials_helper_test.rb +0 -30
  125. data/test/dummy/test/unit/helpers/products_helper_test.rb +0 -30
  126. data/test/dummy/test/unit/material_test.rb +0 -33
  127. data/test/dummy/test/unit/product_test.rb +0 -33
  128. data/test/dummy/test/unit/user_test.rb +0 -33
@@ -1,43 +1,12 @@
1
- # This file is part of the UserStamp library that provides tools to
2
- # track who created, updated, or destroyed a record in the database.
3
- #
4
- # https://github.com/mjpete3/user_stamp
5
- #
6
- # Copyright (C) 2015 PD Technology Solutions, LLC
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining
9
- # a copy of this software and associated documentation files (the
10
- # "Software"), to deal in the Software without restriction, including
11
- # without limitation the rights to use, copy, modify, merge, publish,
12
- # distribute, sublicense, and/or sell copies of the Software, and to
13
- # permit persons to whom the Software is furnished to do so, subject to
14
- # the following conditions:
15
- #
16
- # The above copyright notice and this permission notice shall be
17
- # included in all copies or substantial portions of the Software.
18
- #
19
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-
27
-
28
- # the created_user, updated_user and destroy_user is integer for capturing id fields.
29
1
  class Material < ActiveRecord::Base
30
2
  include UserStamp
31
3
 
32
- attr_accessible :created_user, :deleted, :destroy_user, :name, :updated_user
33
-
34
- scope :not_deleted, where(deleted: false)
4
+ scope :not_deleted, -> {where(deleted: false)}
35
5
 
36
6
  # override the destory method to set the deleted boolean to true.
37
7
  def destroy
38
8
  run_callbacks :destroy do
39
9
  self.update_column(:deleted, true)
40
10
  end
41
- end
42
-
11
+ end
43
12
  end
@@ -1,40 +1,13 @@
1
- # This file is part of the UserStamp library that provides tools to
2
- # track who created, updated, or destroyed a record in the database.
3
- #
4
- # https://github.com/mjpete3/user_stamp
5
- #
6
- # Copyright (C) 2015 PD Technology Solutions, LLC
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining
9
- # a copy of this software and associated documentation files (the
10
- # "Software"), to deal in the Software without restriction, including
11
- # without limitation the rights to use, copy, modify, merge, publish,
12
- # distribute, sublicense, and/or sell copies of the Software, and to
13
- # permit persons to whom the Software is furnished to do so, subject to
14
- # the following conditions:
15
- #
16
- # The above copyright notice and this permission notice shall be
17
- # included in all copies or substantial portions of the Software.
18
- #
19
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-
27
1
  class Product < ActiveRecord::Base
28
2
  include UserStamp
29
3
 
30
- attr_accessible :created_user, :destroy_user, :name, :updated_user, :deleted
31
-
32
- scope :not_deleted, where(deleted: false)
4
+ scope :not_deleted, -> {where(deleted: false)}
33
5
 
34
6
  # override the destory method to set the deleted boolean to true.
35
7
  def destroy
36
8
  run_callbacks :destroy do
37
9
  self.update_column(:deleted, true)
38
10
  end
39
- end
11
+ end
12
+
40
13
  end
@@ -1,36 +1,6 @@
1
- # This file is part of the UserStamp library that provides tools to
2
- # track who created, updated, or destroyed a record in the database.
3
- #
4
- # https://github.com/mjpete3/user_stamp
5
- #
6
- # Copyright (C) 2015 PD Technology Solutions, LLC
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining
9
- # a copy of this software and associated documentation files (the
10
- # "Software"), to deal in the Software without restriction, including
11
- # without limitation the rights to use, copy, modify, merge, publish,
12
- # distribute, sublicense, and/or sell copies of the Software, and to
13
- # permit persons to whom the Software is furnished to do so, subject to
14
- # the following conditions:
15
- #
16
- # The above copyright notice and this permission notice shall be
17
- # included in all copies or substantial portions of the Software.
18
- #
19
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
-
27
1
  class User < ActiveRecord::Base
28
2
  # Include default devise modules. Others available are:
29
3
  # :confirmable, :lockable, :timeoutable and :omniauthable
30
4
  devise :database_authenticatable, :registerable,
31
5
  :recoverable, :rememberable, :trackable, :validatable
32
-
33
- # Setup accessible (or protected) attributes for your model
34
- attr_accessible :email, :password, :password_confirmation, :remember_me
35
- # attr_accessible :title, :body
36
6
  end
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
@@ -4,28 +4,28 @@
4
4
  <h2><%= pluralize(@material.errors.count, "error") %> prohibited this material from being saved:</h2>
5
5
 
6
6
  <ul>
7
- <% @material.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
7
+ <% @material.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
9
  <% end %>
10
10
  </ul>
11
11
  </div>
12
12
  <% end %>
13
13
 
14
14
  <div class="field">
15
- <%= f.label :name %><br />
15
+ <%= f.label :name %><br>
16
16
  <%= f.text_field :name %>
17
17
  </div>
18
18
  <div class="field">
19
- <%= f.label :created_user %><br />
20
- <%= f.text_field :created_user %>
19
+ <%= f.label :created_user %><br>
20
+ <%= f.number_field :created_user %>
21
21
  </div>
22
22
  <div class="field">
23
- <%= f.label :updated_user %><br />
24
- <%= f.text_field :updated_user %>
23
+ <%= f.label :updated_user %><br>
24
+ <%= f.number_field :updated_user %>
25
25
  </div>
26
26
  <div class="field">
27
- <%= f.label :destroy_user %><br />
28
- <%= f.text_field :destroy_user %>
27
+ <%= f.label :destroy_user %><br>
28
+ <%= f.number_field :destroy_user %>
29
29
  </div>
30
30
  <div class="actions">
31
31
  <%= f.submit %>
@@ -1,6 +1,6 @@
1
-
2
- <h1>Edit material</h1>
1
+ <h1>Editing Material</h1>
3
2
 
4
3
  <%= render 'form' %>
5
4
 
5
+ <%= link_to 'Show', @material %> |
6
6
  <%= link_to 'Back', materials_path %>
@@ -1,29 +1,33 @@
1
- <h1>Listing materials</h1>
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Materials</h1>
2
4
 
3
5
  <table>
4
- <tr>
5
- <th>Name</th>
6
- <th>Created user</th>
7
- <th>Updated user</th>
8
- <th>Destroy user</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Created user</th>
10
+ <th>Updated user</th>
11
+ <th>Destroy user</th>
12
+ <th colspan="3"></th>
13
+ </tr>
14
+ </thead>
13
15
 
14
- <% @materials.each do |material| %>
15
- <tr>
16
- <td><%= material.name %></td>
17
- <td><%= material.created_user %></td>
18
- <td><%= material.updated_user %></td>
19
- <td><%= material.destroy_user %></td>
20
- <td><%= link_to 'Show', material %></td>
21
- <td><%= link_to 'Edit', edit_material_path(material) %></td>
22
- <td><%= link_to 'Destroy', material, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
- </tr>
24
- <% end %>
16
+ <tbody>
17
+ <% @materials.each do |material| %>
18
+ <tr>
19
+ <td><%= material.name %></td>
20
+ <td><%= material.created_user %></td>
21
+ <td><%= material.updated_user %></td>
22
+ <td><%= material.destroy_user %></td>
23
+ <td><%= link_to 'Show', material %></td>
24
+ <td><%= link_to 'Edit', edit_material_path(material) %></td>
25
+ <td><%= link_to 'Destroy', material, method: :delete, data: { confirm: 'Are you sure?' } %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
25
29
  </table>
26
30
 
27
- <br />
31
+ <br>
28
32
 
29
- <%= link_to 'New material', new_material_path %>
33
+ <%= link_to 'New Material', new_material_path %>
@@ -1,5 +1,4 @@
1
-
2
- <h1>New material</h1>
1
+ <h1>New Material</h1>
3
2
 
4
3
  <%= render 'form' %>
5
4
 
@@ -1,28 +1,24 @@
1
- <h1>Materials#show</h1>
2
- <p>Find me in app/views/materials/show.html.erb</p>
3
-
4
1
  <p id="notice"><%= notice %></p>
5
2
 
6
3
  <p>
7
- <b>Name:</b>
4
+ <strong>Name:</strong>
8
5
  <%= @material.name %>
9
6
  </p>
10
7
 
11
8
  <p>
12
- <b>Created user:</b>
9
+ <strong>Created user:</strong>
13
10
  <%= @material.created_user %>
14
11
  </p>
15
12
 
16
13
  <p>
17
- <b>Updated user:</b>
14
+ <strong>Updated user:</strong>
18
15
  <%= @material.updated_user %>
19
16
  </p>
20
17
 
21
18
  <p>
22
- <b>Destroy user:</b>
19
+ <strong>Destroy user:</strong>
23
20
  <%= @material.destroy_user %>
24
21
  </p>
25
22
 
26
-
27
23
  <%= link_to 'Edit', edit_material_path(@material) %> |
28
24
  <%= link_to 'Back', materials_path %>
@@ -4,27 +4,27 @@
4
4
  <h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h2>
5
5
 
6
6
  <ul>
7
- <% @product.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
7
+ <% @product.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
9
  <% end %>
10
10
  </ul>
11
11
  </div>
12
12
  <% end %>
13
13
 
14
14
  <div class="field">
15
- <%= f.label :name %><br />
15
+ <%= f.label :name %><br>
16
16
  <%= f.text_field :name %>
17
17
  </div>
18
18
  <div class="field">
19
- <%= f.label :created_user %><br />
19
+ <%= f.label :created_user %><br>
20
20
  <%= f.text_field :created_user %>
21
21
  </div>
22
22
  <div class="field">
23
- <%= f.label :updated_user %><br />
23
+ <%= f.label :updated_user %><br>
24
24
  <%= f.text_field :updated_user %>
25
25
  </div>
26
26
  <div class="field">
27
- <%= f.label :destroy_user %><br />
27
+ <%= f.label :destroy_user %><br>
28
28
  <%= f.text_field :destroy_user %>
29
29
  </div>
30
30
  <div class="actions">
@@ -1,4 +1,4 @@
1
- <h1>Editing product</h1>
1
+ <h1>Editing Product</h1>
2
2
 
3
3
  <%= render 'form' %>
4
4
 
@@ -1,29 +1,33 @@
1
- <h1>Listing products</h1>
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Products</h1>
2
4
 
3
5
  <table>
4
- <tr>
5
- <th>Name</th>
6
- <th>Created user</th>
7
- <th>Updated user</th>
8
- <th>Destroy user</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Created user</th>
10
+ <th>Updated user</th>
11
+ <th>Destroy user</th>
12
+ <th colspan="3"></th>
13
+ </tr>
14
+ </thead>
13
15
 
14
- <% @products.each do |product| %>
15
- <tr>
16
- <td><%= product.name %></td>
17
- <td><%= product.created_user %></td>
18
- <td><%= product.updated_user %></td>
19
- <td><%= product.destroy_user %></td>
20
- <td><%= link_to 'Show', product %></td>
21
- <td><%= link_to 'Edit', edit_product_path(product) %></td>
22
- <td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
- </tr>
24
- <% end %>
16
+ <tbody>
17
+ <% @products.each do |product| %>
18
+ <tr>
19
+ <td><%= product.name %></td>
20
+ <td><%= product.created_user %></td>
21
+ <td><%= product.updated_user %></td>
22
+ <td><%= product.destroy_user %></td>
23
+ <td><%= link_to 'Show', product %></td>
24
+ <td><%= link_to 'Edit', edit_product_path(product) %></td>
25
+ <td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
25
29
  </table>
26
30
 
27
- <br />
31
+ <br>
28
32
 
29
33
  <%= link_to 'New Product', new_product_path %>
@@ -1,4 +1,4 @@
1
- <h1>New product</h1>
1
+ <h1>New Product</h1>
2
2
 
3
3
  <%= render 'form' %>
4
4
 
@@ -1,25 +1,24 @@
1
1
  <p id="notice"><%= notice %></p>
2
2
 
3
3
  <p>
4
- <b>Name:</b>
4
+ <strong>Name:</strong>
5
5
  <%= @product.name %>
6
6
  </p>
7
7
 
8
8
  <p>
9
- <b>Created user:</b>
9
+ <strong>Created user:</strong>
10
10
  <%= @product.created_user %>
11
11
  </p>
12
12
 
13
13
  <p>
14
- <b>Updated user:</b>
14
+ <strong>Updated user:</strong>
15
15
  <%= @product.updated_user %>
16
16
  </p>
17
17
 
18
18
  <p>
19
- <b>Destroy user:</b>
19
+ <strong>Destroy user:</strong>
20
20
  <%= @product.destroy_user %>
21
21
  </p>
22
22
 
23
-
24
23
  <%= link_to 'Edit', edit_product_path(@product) %> |
25
24
  <%= link_to 'Back', products_path %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end