active_admin_editor 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +39 -0
  3. data/Rakefile +38 -0
  4. data/app/assets/images/active_admin/editor/icons.png +0 -0
  5. data/app/assets/javascripts/active_admin/editor.js +23 -0
  6. data/app/assets/javascripts/active_admin/editor/quicksave.js +36 -0
  7. data/app/assets/stylesheets/active_admin/editor.css +136 -0
  8. data/app/assets/stylesheets/active_admin/editor/wysiwyg.css +130 -0
  9. data/app/inputs/html_editor_input.rb +79 -0
  10. data/lib/active_admin/editor.rb +2 -0
  11. data/lib/active_admin/editor/rails/engine.rb +16 -0
  12. data/lib/active_admin/editor/version.rb +5 -0
  13. data/lib/active_admin_editor.rb +1 -0
  14. data/lib/tasks/active_admin_editor_tasks.rake +4 -0
  15. data/test/active_admin_editor_test.rb +7 -0
  16. data/test/dummy/README.rdoc +261 -0
  17. data/test/dummy/Rakefile +7 -0
  18. data/test/dummy/app/admin/dashboards.rb +44 -0
  19. data/test/dummy/app/admin/pages.rb +16 -0
  20. data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
  21. data/test/dummy/app/assets/javascripts/application.js +15 -0
  22. data/test/dummy/app/assets/javascripts/pages.js +2 -0
  23. data/test/dummy/app/assets/stylesheets/active_admin.css.scss +6 -0
  24. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  25. data/test/dummy/app/assets/stylesheets/pages.css.scss +3 -0
  26. data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +56 -0
  27. data/test/dummy/app/controllers/application_controller.rb +3 -0
  28. data/test/dummy/app/controllers/pages_controller.rb +2 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/helpers/pages_helper.rb +2 -0
  31. data/test/dummy/app/models/admin_user.rb +10 -0
  32. data/test/dummy/app/models/page.rb +3 -0
  33. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  34. data/test/dummy/app/views/pages/_form.html.erb +25 -0
  35. data/test/dummy/app/views/pages/edit.html.erb +6 -0
  36. data/test/dummy/app/views/pages/index.html.erb +25 -0
  37. data/test/dummy/app/views/pages/new.html.erb +5 -0
  38. data/test/dummy/app/views/pages/show.html.erb +15 -0
  39. data/test/dummy/config.ru +4 -0
  40. data/test/dummy/config/application.rb +56 -0
  41. data/test/dummy/config/boot.rb +10 -0
  42. data/test/dummy/config/database.yml +25 -0
  43. data/test/dummy/config/environment.rb +5 -0
  44. data/test/dummy/config/environments/development.rb +37 -0
  45. data/test/dummy/config/environments/production.rb +67 -0
  46. data/test/dummy/config/environments/test.rb +37 -0
  47. data/test/dummy/config/initializers/active_admin.rb +129 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/devise.rb +223 -0
  50. data/test/dummy/config/initializers/inflections.rb +15 -0
  51. data/test/dummy/config/initializers/mime_types.rb +5 -0
  52. data/test/dummy/config/initializers/secret_token.rb +7 -0
  53. data/test/dummy/config/initializers/session_store.rb +8 -0
  54. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/test/dummy/config/locales/devise.en.yml +57 -0
  56. data/test/dummy/config/locales/en.yml +5 -0
  57. data/test/dummy/config/routes.rb +64 -0
  58. data/test/dummy/db/development.sqlite3 +0 -0
  59. data/test/dummy/db/migrate/20120430130552_create_admin_notes.rb +17 -0
  60. data/test/dummy/db/migrate/20120430130553_move_admin_notes_to_comments.rb +25 -0
  61. data/test/dummy/db/migrate/20120430200549_devise_create_admin_users.rb +52 -0
  62. data/test/dummy/db/migrate/20120430201522_create_pages.rb +10 -0
  63. data/test/dummy/db/schema.rb +56 -0
  64. data/test/dummy/db/test.sqlite3 +0 -0
  65. data/test/dummy/log/development.log +9246 -0
  66. data/test/dummy/public/404.html +26 -0
  67. data/test/dummy/public/422.html +26 -0
  68. data/test/dummy/public/500.html +25 -0
  69. data/test/dummy/public/favicon.ico +0 -0
  70. data/test/dummy/script/rails +6 -0
  71. data/test/dummy/test/fixtures/admin_users.yml +11 -0
  72. data/test/dummy/test/fixtures/pages.yml +9 -0
  73. data/test/dummy/test/functional/pages_controller_test.rb +49 -0
  74. data/test/dummy/test/unit/admin_user_test.rb +7 -0
  75. data/test/dummy/test/unit/helpers/pages_helper_test.rb +4 -0
  76. data/test/dummy/test/unit/page_test.rb +7 -0
  77. data/test/dummy/tmp/cache/assets/C37/920/sprockets%2F06193740ee7452897ea890866606e46c +0 -0
  78. data/test/dummy/tmp/cache/assets/C71/0E0/sprockets%2F21b76d0a722239c66071874c6c1f103d +0 -0
  79. data/test/dummy/tmp/cache/assets/C72/550/sprockets%2Fb10447885a4e045d14e632325d4167ba +0 -0
  80. data/test/dummy/tmp/cache/assets/C79/430/sprockets%2F239310c864d95b8029081a8cbb51109f +0 -0
  81. data/test/dummy/tmp/cache/assets/C7A/E90/sprockets%2F43393b12e73846b417e5187012f74cab +0 -0
  82. data/test/dummy/tmp/cache/assets/C8E/6F0/sprockets%2F17a15f67b95d85b259346b1988509d0b +0 -0
  83. data/test/dummy/tmp/cache/assets/C9C/4C0/sprockets%2F310c249165fa3e00ec5239562bc245f1 +0 -0
  84. data/test/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  85. data/test/dummy/tmp/cache/assets/CDD/2E0/sprockets%2F0f78bdd85b7f5fd4621224a2c0437572 +0 -0
  86. data/test/dummy/tmp/cache/assets/CE3/2D0/sprockets%2F4d4462dd9972233e700be2e38188ed1d +0 -0
  87. data/test/dummy/tmp/cache/assets/CEC/AF0/sprockets%2F7d8695745080bd838fea849c0d2d3a42 +0 -0
  88. data/test/dummy/tmp/cache/assets/D09/190/sprockets%2F45fb79553642c806213ebc0e22faed63 +0 -0
  89. data/test/dummy/tmp/cache/assets/D13/FE0/sprockets%2Ffb7916af38b70bb578a6d035d2508f18 +0 -0
  90. data/test/dummy/tmp/cache/assets/D24/8D0/sprockets%2F8f2a1bfe27153639fb959a5968b44c8d +0 -0
  91. data/test/dummy/tmp/cache/assets/D2A/F60/sprockets%2Fe73a58b43837c7ff9f6543898b362ebb +0 -0
  92. data/test/dummy/tmp/cache/assets/D2C/800/sprockets%2Fc7dacf6709ba20274c032814cd4e531b +0 -0
  93. data/test/dummy/tmp/cache/assets/D2F/AF0/sprockets%2F701a5254fb5ba1455e860e5c70d07cdb +0 -0
  94. data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  95. data/test/dummy/tmp/cache/assets/D3B/4F0/sprockets%2F6be6ae7be6be4167064d435a34ca1369 +0 -0
  96. data/test/dummy/tmp/cache/assets/D3E/150/sprockets%2Fec3ae7fd44729124d3e7046f33af28a4 +0 -0
  97. data/test/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  98. data/test/dummy/tmp/cache/assets/D4D/D70/sprockets%2F169a66ca31e9576ce9062c9c38bf5e2e +0 -0
  99. data/test/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  100. data/test/dummy/tmp/cache/assets/D64/2C0/sprockets%2Fce4f2416932b7aae7c1e2cdad1343873 +0 -0
  101. data/test/dummy/tmp/cache/assets/D6D/830/sprockets%2Fae3018f4cb13ce743eecf52ff7951532 +0 -0
  102. data/test/dummy/tmp/cache/assets/D75/FD0/sprockets%2Fc7cfc0d19e8f7f5166a4b436ba358e34 +0 -0
  103. data/test/dummy/tmp/cache/assets/D86/680/sprockets%2F16dbbba0db91ea56e2a6a5f6450c2522 +0 -0
  104. data/test/dummy/tmp/cache/assets/D91/A70/sprockets%2F4bc82aa15ade4213e6574aaac1d8387f +0 -0
  105. data/test/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  106. data/test/dummy/tmp/cache/assets/DA3/140/sprockets%2Fbdcfc2e11e8ef8080de86623e8734ad2 +0 -0
  107. data/test/dummy/tmp/cache/assets/DBA/330/sprockets%2Fc80aa22f501364dfa9cbf2b4135efbc4 +0 -0
  108. data/test/dummy/tmp/cache/assets/DCE/D20/sprockets%2Fbb2839e538aadcf1cacde890159b37e2 +0 -0
  109. data/test/dummy/tmp/cache/assets/DD0/820/sprockets%2F92503cd8fdbce38ac5de45630df9d15b +0 -0
  110. data/test/dummy/tmp/cache/assets/DD2/350/sprockets%2Ffabdac3a31a0fd1f9132ff5e89f46993 +0 -0
  111. data/test/dummy/tmp/cache/assets/DD9/760/sprockets%2F96b2c42e56df91c925faff94d3dbfb32 +0 -0
  112. data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  113. data/test/dummy/tmp/cache/assets/DE5/ED0/sprockets%2Fbceb64af6e2b030cc2362a481efae2d2 +0 -0
  114. data/test/dummy/tmp/cache/assets/DF5/940/sprockets%2F68a03b5cb8fac91ac7bb6f7a3703d5ae +0 -0
  115. data/test/dummy/tmp/cache/assets/DFE/710/sprockets%2Fbaba2fa1e1be8d768b866fc59c8b250c +0 -0
  116. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_animation.scssc +0 -0
  117. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_appearance.scssc +0 -0
  118. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-image.scssc +0 -0
  119. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-size.scssc +0 -0
  120. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-image.scssc +0 -0
  121. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-radius.scssc +0 -0
  122. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-shadow.scssc +0 -0
  123. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-sizing.scssc +0 -0
  124. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_columns.scssc +0 -0
  125. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_flex-box.scssc +0 -0
  126. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_inline-block.scssc +0 -0
  127. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_linear-gradient.scssc +0 -0
  128. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_radial-gradient.scssc +0 -0
  129. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transform.scssc +0 -0
  130. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transition.scssc +0 -0
  131. data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_user-select.scssc +0 -0
  132. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_blank_slates.scssc +0 -0
  133. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_breadcrumbs.scssc +0 -0
  134. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_buttons.scssc +0 -0
  135. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_columns.scssc +0 -0
  136. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_comments.css.scssc +0 -0
  137. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_date_picker.css.scssc +0 -0
  138. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_flash_messages.css.scssc +0 -0
  139. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_grid.scssc +0 -0
  140. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_links.scssc +0 -0
  141. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_pagination.scssc +0 -0
  142. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_panels.scssc +0 -0
  143. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_scopes.scssc +0 -0
  144. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_status_tags.scssc +0 -0
  145. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_table_tools.css.scssc +0 -0
  146. data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_tables.css.scssc +0 -0
  147. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_button.scssc +0 -0
  148. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_clearfix.scssc +0 -0
  149. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_font-family.scssc +0 -0
  150. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_html5-input-types.scssc +0 -0
  151. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_position.scssc +0 -0
  152. data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_timing-functions.scssc +0 -0
  153. data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_dashboard.scssc +0 -0
  154. data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_logged_out.scssc +0 -0
  155. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_footer.scssc +0 -0
  156. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_main_structure.scssc +0 -0
  157. data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_title_bar.scssc +0 -0
  158. data/test/dummy/tmp/cache/sass/6b007881be7ebec964704521003b1d386a87a62e/active_admin.css.scssc +0 -0
  159. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_deprecated-webkit-gradient.scssc +0 -0
  160. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_flex-grid.scssc +0 -0
  161. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_grid-width.scssc +0 -0
  162. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_linear-gradient.scssc +0 -0
  163. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_modular-scale.scssc +0 -0
  164. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_radial-gradient.scssc +0 -0
  165. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_render-gradients.scssc +0 -0
  166. data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_tint-shade.scssc +0 -0
  167. data/test/dummy/tmp/cache/sass/9281732a5ed473e2068958b0e7f25e8bbdf281c1/_bourbon.scssc +0 -0
  168. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_all.css.scssc +0 -0
  169. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_buttons.css.scssc +0 -0
  170. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_gradients.css.scssc +0 -0
  171. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_icons.css.scssc +0 -0
  172. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_reset.css.scssc +0 -0
  173. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_rounded.css.scssc +0 -0
  174. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_sections.css.scssc +0 -0
  175. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_shadows.css.scssc +0 -0
  176. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_typography.scssc +0 -0
  177. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_utilities.scssc +0 -0
  178. data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_variables.css.scssc +0 -0
  179. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_base.css.scssc +0 -0
  180. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_forms.css.scssc +0 -0
  181. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_header.css.scssc +0 -0
  182. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_mixins.css.scssc +0 -0
  183. data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_typography.css.scssc +0 -0
  184. data/test/test_helper.rb +15 -0
  185. metadata +454 -0
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ class PagesController < InheritedResources::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module PagesHelper
2
+ end
@@ -0,0 +1,10 @@
1
+ class AdminUser < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
4
+ devise :database_authenticatable,
5
+ :recoverable, :rememberable, :trackable, :validatable
6
+
7
+ # Setup accessible (or protected) attributes for your model
8
+ attr_accessible :email, :password, :password_confirmation, :remember_me
9
+ # attr_accessible :title, :body
10
+ end
@@ -0,0 +1,3 @@
1
+ class Page < ActiveRecord::Base
2
+ attr_accessible :content, :title
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,25 @@
1
+ <%= form_for(@page) do |f| %>
2
+ <% if @page.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @page.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :title %><br />
16
+ <%= f.text_field :title %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :content %><br />
20
+ <%= f.text_area :content %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing page</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @page %> |
6
+ <%= link_to 'Back', pages_path %>
@@ -0,0 +1,25 @@
1
+ <h1>Listing pages</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Title</th>
6
+ <th>Content</th>
7
+ <th></th>
8
+ <th></th>
9
+ <th></th>
10
+ </tr>
11
+
12
+ <% @pages.each do |page| %>
13
+ <tr>
14
+ <td><%= page.title %></td>
15
+ <td><%= page.content %></td>
16
+ <td><%= link_to 'Show', page %></td>
17
+ <td><%= link_to 'Edit', edit_page_path(page) %></td>
18
+ <td><%= link_to 'Destroy', page, confirm: 'Are you sure?', method: :delete %></td>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+
23
+ <br />
24
+
25
+ <%= link_to 'New Page', new_page_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New page</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', pages_path %>
@@ -0,0 +1,15 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Title:</b>
5
+ <%= @page.title %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Content:</b>
10
+ <%= @page.content %>
11
+ </p>
12
+
13
+
14
+ <%= link_to 'Edit', edit_page_path(@page) %> |
15
+ <%= link_to 'Back', pages_path %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,56 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require "active_admin_editor"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = "utf-8"
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Use SQL instead of Active Record's schema dumper when creating the database.
39
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
40
+ # like if you have constraints or database-specific column types
41
+ # config.active_record.schema_format = :sql
42
+
43
+ # Enforce whitelist mode for mass assignment.
44
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
45
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
46
+ # parameters by using an attr_accessible or attr_protected declaration.
47
+ config.active_record.whitelist_attributes = true
48
+
49
+ # Enable the asset pipeline
50
+ config.assets.enabled = true
51
+
52
+ # Version of your assets, change this if you want to expire all your assets
53
+ config.assets.version = '1.0'
54
+ end
55
+ end
56
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,129 @@
1
+ ActiveAdmin.setup do |config|
2
+
3
+ # == Site Title
4
+ #
5
+ # Set the title that is displayed on the main layout
6
+ # for each of the active admin pages.
7
+ #
8
+ config.site_title = "Dummy"
9
+
10
+ # Set the link url for the title. For example, to take
11
+ # users to your main site. Defaults to no link.
12
+ #
13
+ # config.site_title_link = "/"
14
+
15
+ # Set an optional image to be displayed for the header
16
+ # instead of a string (overrides :site_title)
17
+ #
18
+ # Note: Recommended image height is 21px to properly fit in the header
19
+ #
20
+ # config.site_title_image = "/images/logo.png"
21
+
22
+ # == Default Namespace
23
+ #
24
+ # Set the default namespace each administration resource
25
+ # will be added to.
26
+ #
27
+ # eg:
28
+ # config.default_namespace = :hello_world
29
+ #
30
+ # This will create resources in the HelloWorld module and
31
+ # will namespace routes to /hello_world/*
32
+ #
33
+ # To set no namespace by default, use:
34
+ # config.default_namespace = false
35
+ #
36
+ # Default:
37
+ # config.default_namespace = :admin
38
+ #
39
+ # You can customize the settings for each namespace by using
40
+ # a namespace block. For example, to change the site title
41
+ # within a namespace:
42
+ #
43
+ # config.namespace :admin do |admin|
44
+ # admin.site_title = "Custom Admin Title"
45
+ # end
46
+ #
47
+ # This will ONLY change the title for the admin section. Other
48
+ # namespaces will continue to use the main "site_title" configuration.
49
+
50
+ # == User Authentication
51
+ #
52
+ # Active Admin will automatically call an authentication
53
+ # method in a before filter of all controller actions to
54
+ # ensure that there is a currently logged in admin user.
55
+ #
56
+ # This setting changes the method which Active Admin calls
57
+ # within the controller.
58
+ config.authentication_method = :authenticate_admin_user!
59
+
60
+
61
+ # == Current User
62
+ #
63
+ # Active Admin will associate actions with the current
64
+ # user performing them.
65
+ #
66
+ # This setting changes the method which Active Admin calls
67
+ # to return the currently logged in user.
68
+ config.current_user_method = :current_admin_user
69
+
70
+
71
+ # == Logging Out
72
+ #
73
+ # Active Admin displays a logout link on each screen. These
74
+ # settings configure the location and method used for the link.
75
+ #
76
+ # This setting changes the path where the link points to. If it's
77
+ # a string, the strings is used as the path. If it's a Symbol, we
78
+ # will call the method to return the path.
79
+ #
80
+ # Default:
81
+ config.logout_link_path = :destroy_admin_user_session_path
82
+
83
+ # This setting changes the http method used when rendering the
84
+ # link. For example :get, :delete, :put, etc..
85
+ #
86
+ # Default:
87
+ # config.logout_link_method = :get
88
+
89
+
90
+ # == Admin Comments
91
+ #
92
+ # Admin comments allow you to add comments to any model for admin use.
93
+ # Admin comments are enabled by default.
94
+ #
95
+ # Default:
96
+ # config.allow_comments = true
97
+ #
98
+ # You can turn them on and off for any given namespace by using a
99
+ # namespace config block.
100
+ #
101
+ # Eg:
102
+ # config.namespace :without_comments do |without_comments|
103
+ # without_comments.allow_comments = false
104
+ # end
105
+
106
+
107
+ # == Controller Filters
108
+ #
109
+ # You can add before, after and around filters to all of your
110
+ # Active Admin resources from here.
111
+ #
112
+ # config.before_filter :do_something_awesome
113
+
114
+
115
+ # == Register Stylesheets & Javascripts
116
+ #
117
+ # We recommend using the built in Active Admin layout and loading
118
+ # up your own stylesheets / javascripts to customize the look
119
+ # and feel.
120
+ #
121
+ # To load a stylesheet:
122
+ # config.register_stylesheet 'my_stylesheet.css'
123
+ #
124
+ # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
125
+ # config.register_stylesheet 'my_print_stylesheet.css', :media => :print
126
+ #
127
+ # To load a javascript file:
128
+ # config.register_javascript 'my_javascript.js'
129
+ end