sandboxy 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +26 -36
  4. data/{examples/rails_example/app → app}/models/sandbox.rb +1 -1
  5. data/lib/generators/sandboxy_generator.rb +0 -4
  6. data/lib/generators/templates/initializer.rb +7 -7
  7. data/lib/generators/templates/migration.rb.erb +4 -9
  8. data/lib/sandboxy.rb +2 -9
  9. data/lib/sandboxy/configuration.rb +37 -10
  10. data/lib/sandboxy/engine.rb +6 -0
  11. data/lib/sandboxy/middleware.rb +3 -3
  12. data/lib/sandboxy/railtie.rb +7 -6
  13. data/lib/sandboxy/sandboxed.rb +69 -19
  14. data/lib/sandboxy/version.rb +1 -1
  15. metadata +5 -197
  16. data/.github/issue_template.md +0 -14
  17. data/.github/pull_request_template.md +0 -21
  18. data/.gitignore +0 -8
  19. data/.travis.yml +0 -3
  20. data/CODE_OF_CONDUCT.md +0 -46
  21. data/CONTRIBUTING.md +0 -1
  22. data/DEPRECATIONS.md +0 -5
  23. data/Gemfile +0 -9
  24. data/INSTALL.md +0 -3
  25. data/Rakefile +0 -15
  26. data/examples/rails_example/.gitignore +0 -23
  27. data/examples/rails_example/Gemfile +0 -54
  28. data/examples/rails_example/README.md +0 -24
  29. data/examples/rails_example/Rakefile +0 -6
  30. data/examples/rails_example/app/api/books/api.rb +0 -33
  31. data/examples/rails_example/app/assets/config/manifest.js +0 -3
  32. data/examples/rails_example/app/assets/images/.keep +0 -0
  33. data/examples/rails_example/app/assets/javascripts/application.js +0 -15
  34. data/examples/rails_example/app/assets/javascripts/applications.coffee +0 -3
  35. data/examples/rails_example/app/assets/javascripts/authors.coffee +0 -3
  36. data/examples/rails_example/app/assets/javascripts/books.coffee +0 -3
  37. data/examples/rails_example/app/assets/javascripts/cable.js +0 -13
  38. data/examples/rails_example/app/assets/javascripts/channels/.keep +0 -0
  39. data/examples/rails_example/app/assets/javascripts/libraries.coffee +0 -3
  40. data/examples/rails_example/app/assets/javascripts/sandbox.coffee +0 -3
  41. data/examples/rails_example/app/assets/stylesheets/application.css +0 -15
  42. data/examples/rails_example/app/assets/stylesheets/applications.scss +0 -3
  43. data/examples/rails_example/app/assets/stylesheets/authors.scss +0 -3
  44. data/examples/rails_example/app/assets/stylesheets/books.scss +0 -3
  45. data/examples/rails_example/app/assets/stylesheets/libraries.scss +0 -3
  46. data/examples/rails_example/app/assets/stylesheets/sandbox.scss +0 -3
  47. data/examples/rails_example/app/assets/stylesheets/scaffolds.scss +0 -84
  48. data/examples/rails_example/app/channels/application_cable/channel.rb +0 -4
  49. data/examples/rails_example/app/channels/application_cable/connection.rb +0 -4
  50. data/examples/rails_example/app/controllers/application_controller.rb +0 -7
  51. data/examples/rails_example/app/controllers/applications_controller.rb +0 -74
  52. data/examples/rails_example/app/controllers/authors_controller.rb +0 -77
  53. data/examples/rails_example/app/controllers/books_controller.rb +0 -77
  54. data/examples/rails_example/app/controllers/concerns/.keep +0 -0
  55. data/examples/rails_example/app/controllers/libraries_controller.rb +0 -77
  56. data/examples/rails_example/app/controllers/sandbox_controller.rb +0 -6
  57. data/examples/rails_example/app/helpers/application_helper.rb +0 -2
  58. data/examples/rails_example/app/helpers/applications_helper.rb +0 -2
  59. data/examples/rails_example/app/helpers/authors_helper.rb +0 -2
  60. data/examples/rails_example/app/helpers/books_helper.rb +0 -2
  61. data/examples/rails_example/app/helpers/libraries_helper.rb +0 -2
  62. data/examples/rails_example/app/helpers/sandbox_helper.rb +0 -2
  63. data/examples/rails_example/app/jobs/application_job.rb +0 -2
  64. data/examples/rails_example/app/mailers/application_mailer.rb +0 -4
  65. data/examples/rails_example/app/models/application.rb +0 -14
  66. data/examples/rails_example/app/models/application_record.rb +0 -3
  67. data/examples/rails_example/app/models/author.rb +0 -2
  68. data/examples/rails_example/app/models/book.rb +0 -2
  69. data/examples/rails_example/app/models/concerns/.keep +0 -0
  70. data/examples/rails_example/app/models/library.rb +0 -2
  71. data/examples/rails_example/app/views/applications/_application.json.jbuilder +0 -2
  72. data/examples/rails_example/app/views/applications/_form.html.erb +0 -19
  73. data/examples/rails_example/app/views/applications/edit.html.erb +0 -6
  74. data/examples/rails_example/app/views/applications/index.html.erb +0 -25
  75. data/examples/rails_example/app/views/applications/index.json.jbuilder +0 -1
  76. data/examples/rails_example/app/views/applications/new.html.erb +0 -5
  77. data/examples/rails_example/app/views/applications/show.html.erb +0 -7
  78. data/examples/rails_example/app/views/applications/show.json.jbuilder +0 -1
  79. data/examples/rails_example/app/views/authors/_author.json.jbuilder +0 -2
  80. data/examples/rails_example/app/views/authors/_form.html.erb +0 -19
  81. data/examples/rails_example/app/views/authors/edit.html.erb +0 -6
  82. data/examples/rails_example/app/views/authors/index.html.erb +0 -25
  83. data/examples/rails_example/app/views/authors/index.json.jbuilder +0 -1
  84. data/examples/rails_example/app/views/authors/new.html.erb +0 -5
  85. data/examples/rails_example/app/views/authors/show.html.erb +0 -4
  86. data/examples/rails_example/app/views/authors/show.json.jbuilder +0 -1
  87. data/examples/rails_example/app/views/books/_book.json.jbuilder +0 -2
  88. data/examples/rails_example/app/views/books/_form.html.erb +0 -19
  89. data/examples/rails_example/app/views/books/edit.html.erb +0 -6
  90. data/examples/rails_example/app/views/books/index.html.erb +0 -25
  91. data/examples/rails_example/app/views/books/index.json.jbuilder +0 -1
  92. data/examples/rails_example/app/views/books/new.html.erb +0 -5
  93. data/examples/rails_example/app/views/books/show.html.erb +0 -4
  94. data/examples/rails_example/app/views/books/show.json.jbuilder +0 -1
  95. data/examples/rails_example/app/views/layouts/application.html.erb +0 -14
  96. data/examples/rails_example/app/views/layouts/mailer.html.erb +0 -13
  97. data/examples/rails_example/app/views/layouts/mailer.text.erb +0 -1
  98. data/examples/rails_example/app/views/libraries/_form.html.erb +0 -19
  99. data/examples/rails_example/app/views/libraries/_library.json.jbuilder +0 -2
  100. data/examples/rails_example/app/views/libraries/edit.html.erb +0 -6
  101. data/examples/rails_example/app/views/libraries/index.html.erb +0 -25
  102. data/examples/rails_example/app/views/libraries/index.json.jbuilder +0 -1
  103. data/examples/rails_example/app/views/libraries/new.html.erb +0 -5
  104. data/examples/rails_example/app/views/libraries/show.html.erb +0 -4
  105. data/examples/rails_example/app/views/libraries/show.json.jbuilder +0 -1
  106. data/examples/rails_example/bin/bundle +0 -3
  107. data/examples/rails_example/bin/rails +0 -4
  108. data/examples/rails_example/bin/rake +0 -4
  109. data/examples/rails_example/bin/setup +0 -38
  110. data/examples/rails_example/bin/update +0 -29
  111. data/examples/rails_example/bin/yarn +0 -11
  112. data/examples/rails_example/config.ru +0 -5
  113. data/examples/rails_example/config/application.rb +0 -18
  114. data/examples/rails_example/config/boot.rb +0 -3
  115. data/examples/rails_example/config/cable.yml +0 -10
  116. data/examples/rails_example/config/database.yml +0 -25
  117. data/examples/rails_example/config/environment.rb +0 -5
  118. data/examples/rails_example/config/environments/development.rb +0 -54
  119. data/examples/rails_example/config/environments/production.rb +0 -91
  120. data/examples/rails_example/config/environments/test.rb +0 -42
  121. data/examples/rails_example/config/initializers/application_controller_renderer.rb +0 -6
  122. data/examples/rails_example/config/initializers/assets.rb +0 -14
  123. data/examples/rails_example/config/initializers/backtrace_silencers.rb +0 -7
  124. data/examples/rails_example/config/initializers/cookies_serializer.rb +0 -5
  125. data/examples/rails_example/config/initializers/filter_parameter_logging.rb +0 -4
  126. data/examples/rails_example/config/initializers/grape.rb +0 -2
  127. data/examples/rails_example/config/initializers/inflections.rb +0 -16
  128. data/examples/rails_example/config/initializers/mime_types.rb +0 -4
  129. data/examples/rails_example/config/initializers/sandboxy.rb +0 -13
  130. data/examples/rails_example/config/initializers/wrap_parameters.rb +0 -14
  131. data/examples/rails_example/config/locales/en.yml +0 -33
  132. data/examples/rails_example/config/puma.rb +0 -56
  133. data/examples/rails_example/config/routes.rb +0 -13
  134. data/examples/rails_example/config/secrets.yml +0 -32
  135. data/examples/rails_example/db/migrate/20170827184048_create_books.rb +0 -9
  136. data/examples/rails_example/db/migrate/20170827184054_create_authors.rb +0 -9
  137. data/examples/rails_example/db/migrate/20170827184106_create_libraries.rb +0 -9
  138. data/examples/rails_example/db/migrate/20170827184304_create_applications.rb +0 -11
  139. data/examples/rails_example/db/migrate/20170827190815_sandboxy_migration.rb +0 -14
  140. data/examples/rails_example/db/schema.rb +0 -50
  141. data/examples/rails_example/db/seeds.rb +0 -7
  142. data/examples/rails_example/lib/assets/.keep +0 -0
  143. data/examples/rails_example/lib/tasks/.keep +0 -0
  144. data/examples/rails_example/package.json +0 -5
  145. data/examples/rails_example/public/404.html +0 -67
  146. data/examples/rails_example/public/422.html +0 -67
  147. data/examples/rails_example/public/500.html +0 -66
  148. data/examples/rails_example/public/apple-touch-icon-precomposed.png +0 -0
  149. data/examples/rails_example/public/apple-touch-icon.png +0 -0
  150. data/examples/rails_example/public/favicon.ico +0 -0
  151. data/examples/rails_example/public/robots.txt +0 -1
  152. data/examples/rails_example/test/application_system_test_case.rb +0 -5
  153. data/examples/rails_example/test/controllers/.keep +0 -0
  154. data/examples/rails_example/test/controllers/applications_controller_test.rb +0 -48
  155. data/examples/rails_example/test/controllers/authors_controller_test.rb +0 -48
  156. data/examples/rails_example/test/controllers/books_controller_test.rb +0 -48
  157. data/examples/rails_example/test/controllers/libraries_controller_test.rb +0 -48
  158. data/examples/rails_example/test/controllers/sandbox_controller_test.rb +0 -7
  159. data/examples/rails_example/test/fixtures/.keep +0 -0
  160. data/examples/rails_example/test/fixtures/applications.yml +0 -11
  161. data/examples/rails_example/test/fixtures/authors.yml +0 -11
  162. data/examples/rails_example/test/fixtures/books.yml +0 -11
  163. data/examples/rails_example/test/fixtures/files/.keep +0 -0
  164. data/examples/rails_example/test/fixtures/libraries.yml +0 -11
  165. data/examples/rails_example/test/helpers/.keep +0 -0
  166. data/examples/rails_example/test/integration/.keep +0 -0
  167. data/examples/rails_example/test/mailers/.keep +0 -0
  168. data/examples/rails_example/test/models/.keep +0 -0
  169. data/examples/rails_example/test/models/application_test.rb +0 -7
  170. data/examples/rails_example/test/models/author_test.rb +0 -7
  171. data/examples/rails_example/test/models/book_test.rb +0 -7
  172. data/examples/rails_example/test/models/library_test.rb +0 -7
  173. data/examples/rails_example/test/system/.keep +0 -0
  174. data/examples/rails_example/test/system/applications_test.rb +0 -9
  175. data/examples/rails_example/test/system/authors_test.rb +0 -9
  176. data/examples/rails_example/test/system/books_test.rb +0 -9
  177. data/examples/rails_example/test/system/libraries_test.rb +0 -9
  178. data/examples/rails_example/test/test_helper.rb +0 -9
  179. data/examples/rails_example/tmp/.keep +0 -0
  180. data/examples/rails_example/vendor/.keep +0 -0
  181. data/init.rb +0 -1
  182. data/lib/generators/templates/model.rb +0 -7
  183. data/sandboxy.gemspec +0 -28
  184. data/test/dummy30/Gemfile +0 -1
  185. data/test/dummy30/Rakefile +0 -4
  186. data/test/dummy30/app/models/application_record.rb +0 -3
  187. data/test/dummy30/app/models/shared_sandbox.rb +0 -4
  188. data/test/dummy30/app/models/some.rb +0 -3
  189. data/test/dummy30/app/models/user.rb +0 -3
  190. data/test/dummy30/config.ru +0 -2
  191. data/test/dummy30/config/application.rb +0 -14
  192. data/test/dummy30/config/boot.rb +0 -10
  193. data/test/dummy30/config/database.yml +0 -6
  194. data/test/dummy30/config/environment.rb +0 -5
  195. data/test/dummy30/config/environments/development.rb +0 -7
  196. data/test/dummy30/config/environments/test.rb +0 -6
  197. data/test/dummy30/config/initializers/sandboxy.rb +0 -13
  198. data/test/dummy30/config/initializers/secret_token.rb +0 -1
  199. data/test/dummy30/config/initializers/session_store.rb +0 -1
  200. data/test/dummy30/config/locales/en.yml +0 -2
  201. data/test/dummy30/config/routes.rb +0 -2
  202. data/test/dummy30/config/sandboxy.yml +0 -1
  203. data/test/factories/somes.rb +0 -17
  204. data/test/factories/users.rb +0 -5
  205. data/test/sandbox_test.rb +0 -51
  206. data/test/sandboxed_test.rb +0 -58
  207. data/test/schema.rb +0 -18
  208. data/test/test_helper.rb +0 -20
@@ -1,77 +0,0 @@
1
- class LibrariesController < ApplicationController
2
- before_action :set_library, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /libraries
5
- # GET /libraries.json
6
- def index
7
- $sandbox = session[:sandbox]
8
- @libraries = Library.all
9
- end
10
-
11
- # GET /libraries/1
12
- # GET /libraries/1.json
13
- def show
14
- end
15
-
16
- # GET /libraries/new
17
- def new
18
- $sandbox = session[:sandbox]
19
- @library = Library.new
20
- end
21
-
22
- # GET /libraries/1/edit
23
- def edit
24
- end
25
-
26
- # POST /libraries
27
- # POST /libraries.json
28
- def create
29
- $sandbox = session[:sandbox]
30
- @library = Library.new(library_params)
31
-
32
- respond_to do |format|
33
- if @library.save
34
- format.html { redirect_to @library, notice: 'Library was successfully created.' }
35
- format.json { render :show, status: :created, location: @library }
36
- else
37
- format.html { render :new }
38
- format.json { render json: @library.errors, status: :unprocessable_entity }
39
- end
40
- end
41
- end
42
-
43
- # PATCH/PUT /libraries/1
44
- # PATCH/PUT /libraries/1.json
45
- def update
46
- respond_to do |format|
47
- if @library.update(library_params)
48
- format.html { redirect_to @library, notice: 'Library was successfully updated.' }
49
- format.json { render :show, status: :ok, location: @library }
50
- else
51
- format.html { render :edit }
52
- format.json { render json: @library.errors, status: :unprocessable_entity }
53
- end
54
- end
55
- end
56
-
57
- # DELETE /libraries/1
58
- # DELETE /libraries/1.json
59
- def destroy
60
- @library.destroy
61
- respond_to do |format|
62
- format.html { redirect_to libraries_url, notice: 'Library was successfully destroyed.' }
63
- format.json { head :no_content }
64
- end
65
- end
66
-
67
- private
68
- # Use callbacks to share common setup or constraints between actions.
69
- def set_library
70
- @library = Library.find(params[:id])
71
- end
72
-
73
- # Never trust parameters from the scary internet, only allow the white list through.
74
- def library_params
75
- params.fetch(:library, {})
76
- end
77
- end
@@ -1,6 +0,0 @@
1
- class SandboxController < ApplicationController
2
- def edit
3
- session[:sandbox] == !session[:sandbox]
4
- redirect_to root_url
5
- end
6
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module ApplicationsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module AuthorsHelper
2
- end
@@ -1,2 +0,0 @@
1
- module BooksHelper
2
- end
@@ -1,2 +0,0 @@
1
- module LibrariesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module SandboxHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
4
- end
@@ -1,14 +0,0 @@
1
- class Application < ApplicationRecord
2
- before_create :create_access_tokens
3
-
4
- private
5
-
6
- def create_access_tokens
7
- begin
8
- self.access_token = SecureRandom.hex(32)
9
- end while self.class.where(access_token: self.access_token, sandbox_access_token: self.access_token).exists?
10
- begin
11
- self.sandbox_access_token = SecureRandom.hex(32)
12
- end while self.class.where(sandbox_access_token: self.sandbox_access_token, access_token: self.sandbox_access_token).exists?
13
- end
14
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,2 +0,0 @@
1
- class Author < ApplicationRecord
2
- end
@@ -1,2 +0,0 @@
1
- class Book < ApplicationRecord
2
- end
@@ -1,2 +0,0 @@
1
- class Library < ApplicationRecord
2
- end
@@ -1,2 +0,0 @@
1
- json.extract! application, :id, :created_at, :updated_at
2
- json.url application_url(application, format: :json)
@@ -1,19 +0,0 @@
1
- <%= form_with(model: application, local: true) do |form| %>
2
- <% if application.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(application.errors.count, "error") %> prohibited this application from being saved:</h2>
5
-
6
- <ul>
7
- <% application.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <%= form.input :name %>
15
-
16
- <div class="actions">
17
- <%= form.submit %>
18
- </div>
19
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Application</h1>
2
-
3
- <%= render 'form', application: @application %>
4
-
5
- <%= link_to 'Show', @application %> |
6
- <%= link_to 'Back', applications_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Applications</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @applications.each do |application| %>
14
- <tr>
15
- <td><%= link_to 'Show', application %></td>
16
- <td><%= link_to 'Edit', edit_application_path(application) %></td>
17
- <td><%= link_to 'Destroy', application, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Application', new_application_path %>
@@ -1 +0,0 @@
1
- json.array! @applications, partial: 'applications/application', as: :application
@@ -1,5 +0,0 @@
1
- <h1>New Application</h1>
2
-
3
- <%= render 'form', application: @application %>
4
-
5
- <%= link_to 'Back', applications_path %>
@@ -1,7 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <%= link_to 'Edit', edit_application_path(@application) %> |
4
- <%= link_to 'Back', applications_path %>
5
-
6
- Live Access Token: <%= @application.access_token %>
7
- Sandbox Access Token: <%= @application.sandbox_access_token %>
@@ -1 +0,0 @@
1
- json.partial! "applications/application", application: @application
@@ -1,2 +0,0 @@
1
- json.extract! author, :id, :created_at, :updated_at
2
- json.url author_url(author, format: :json)
@@ -1,19 +0,0 @@
1
- <%= form_with(model: author, local: true) do |form| %>
2
- <% if author.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(author.errors.count, "error") %> prohibited this author from being saved:</h2>
5
-
6
- <ul>
7
- <% author.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <%= form.input :name %>
15
-
16
- <div class="actions">
17
- <%= form.submit %>
18
- </div>
19
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Author</h1>
2
-
3
- <%= render 'form', author: @author %>
4
-
5
- <%= link_to 'Show', @author %> |
6
- <%= link_to 'Back', authors_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Authors</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @authors.each do |author| %>
14
- <tr>
15
- <td><%= link_to 'Show', author %></td>
16
- <td><%= link_to 'Edit', edit_author_path(author) %></td>
17
- <td><%= link_to 'Destroy', author, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Author', new_author_path %>
@@ -1 +0,0 @@
1
- json.array! @authors, partial: 'authors/author', as: :author
@@ -1,5 +0,0 @@
1
- <h1>New Author</h1>
2
-
3
- <%= render 'form', author: @author %>
4
-
5
- <%= link_to 'Back', authors_path %>
@@ -1,4 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <%= link_to 'Edit', edit_author_path(@author) %> |
4
- <%= link_to 'Back', authors_path %>
@@ -1 +0,0 @@
1
- json.partial! "authors/author", author: @author
@@ -1,2 +0,0 @@
1
- json.extract! book, :id, :created_at, :updated_at
2
- json.url book_url(book, format: :json)
@@ -1,19 +0,0 @@
1
- <%= form_with(model: book, local: true) do |form| %>
2
- <% if book.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(book.errors.count, "error") %> prohibited this book from being saved:</h2>
5
-
6
- <ul>
7
- <% book.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <%= form.input :name %>
15
-
16
- <div class="actions">
17
- <%= form.submit %>
18
- </div>
19
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Book</h1>
2
-
3
- <%= render 'form', book: @book %>
4
-
5
- <%= link_to 'Show', @book %> |
6
- <%= link_to 'Back', books_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Books</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th colspan="3"></th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- <% @books.each do |book| %>
14
- <tr>
15
- <td><%= link_to 'Show', book %></td>
16
- <td><%= link_to 'Edit', edit_book_path(book) %></td>
17
- <td><%= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </tbody>
21
- </table>
22
-
23
- <br>
24
-
25
- <%= link_to 'New Book', new_book_path %>
@@ -1 +0,0 @@
1
- json.array! @books, partial: 'books/book', as: :book
@@ -1,5 +0,0 @@
1
- <h1>New Book</h1>
2
-
3
- <%= render 'form', book: @book %>
4
-
5
- <%= link_to 'Back', books_path %>
@@ -1,4 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <%= link_to 'Edit', edit_book_path(@book) %> |
4
- <%= link_to 'Back', books_path %>
@@ -1 +0,0 @@
1
- json.partial! "books/book", book: @book
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>RailsExample</title>
5
- <%= csrf_meta_tags %>
6
-
7
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
- <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
- </head>
10
-
11
- <body>
12
- <%= yield %>
13
- </body>
14
- </html>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1,19 +0,0 @@
1
- <%= form_with(model: library, local: true) do |form| %>
2
- <% if library.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(library.errors.count, "error") %> prohibited this library from being saved:</h2>
5
-
6
- <ul>
7
- <% library.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <%= form.input :name %>
15
-
16
- <div class="actions">
17
- <%= form.submit %>
18
- </div>
19
- <% end %>