active_admin_editor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +39 -0
- data/Rakefile +38 -0
- data/app/assets/images/active_admin/editor/icons.png +0 -0
- data/app/assets/javascripts/active_admin/editor.js +23 -0
- data/app/assets/javascripts/active_admin/editor/quicksave.js +36 -0
- data/app/assets/stylesheets/active_admin/editor.css +136 -0
- data/app/assets/stylesheets/active_admin/editor/wysiwyg.css +130 -0
- data/app/inputs/html_editor_input.rb +79 -0
- data/lib/active_admin/editor.rb +2 -0
- data/lib/active_admin/editor/rails/engine.rb +16 -0
- data/lib/active_admin/editor/version.rb +5 -0
- data/lib/active_admin_editor.rb +1 -0
- data/lib/tasks/active_admin_editor_tasks.rake +4 -0
- data/test/active_admin_editor_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/admin/dashboards.rb +44 -0
- data/test/dummy/app/admin/pages.rb +16 -0
- data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/pages.js +2 -0
- data/test/dummy/app/assets/stylesheets/active_admin.css.scss +6 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/pages.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +56 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/pages_controller.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/pages_helper.rb +2 -0
- data/test/dummy/app/models/admin_user.rb +10 -0
- data/test/dummy/app/models/page.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/pages/_form.html.erb +25 -0
- data/test/dummy/app/views/pages/edit.html.erb +6 -0
- data/test/dummy/app/views/pages/index.html.erb +25 -0
- data/test/dummy/app/views/pages/new.html.erb +5 -0
- data/test/dummy/app/views/pages/show.html.erb +15 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +56 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/active_admin.rb +129 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +223 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/devise.en.yml +57 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +64 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20120430130552_create_admin_notes.rb +17 -0
- data/test/dummy/db/migrate/20120430130553_move_admin_notes_to_comments.rb +25 -0
- data/test/dummy/db/migrate/20120430200549_devise_create_admin_users.rb +52 -0
- data/test/dummy/db/migrate/20120430201522_create_pages.rb +10 -0
- data/test/dummy/db/schema.rb +56 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +9246 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/admin_users.yml +11 -0
- data/test/dummy/test/fixtures/pages.yml +9 -0
- data/test/dummy/test/functional/pages_controller_test.rb +49 -0
- data/test/dummy/test/unit/admin_user_test.rb +7 -0
- data/test/dummy/test/unit/helpers/pages_helper_test.rb +4 -0
- data/test/dummy/test/unit/page_test.rb +7 -0
- data/test/dummy/tmp/cache/assets/C37/920/sprockets%2F06193740ee7452897ea890866606e46c +0 -0
- data/test/dummy/tmp/cache/assets/C71/0E0/sprockets%2F21b76d0a722239c66071874c6c1f103d +0 -0
- data/test/dummy/tmp/cache/assets/C72/550/sprockets%2Fb10447885a4e045d14e632325d4167ba +0 -0
- data/test/dummy/tmp/cache/assets/C79/430/sprockets%2F239310c864d95b8029081a8cbb51109f +0 -0
- data/test/dummy/tmp/cache/assets/C7A/E90/sprockets%2F43393b12e73846b417e5187012f74cab +0 -0
- data/test/dummy/tmp/cache/assets/C8E/6F0/sprockets%2F17a15f67b95d85b259346b1988509d0b +0 -0
- data/test/dummy/tmp/cache/assets/C9C/4C0/sprockets%2F310c249165fa3e00ec5239562bc245f1 +0 -0
- data/test/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
- data/test/dummy/tmp/cache/assets/CDD/2E0/sprockets%2F0f78bdd85b7f5fd4621224a2c0437572 +0 -0
- data/test/dummy/tmp/cache/assets/CE3/2D0/sprockets%2F4d4462dd9972233e700be2e38188ed1d +0 -0
- data/test/dummy/tmp/cache/assets/CEC/AF0/sprockets%2F7d8695745080bd838fea849c0d2d3a42 +0 -0
- data/test/dummy/tmp/cache/assets/D09/190/sprockets%2F45fb79553642c806213ebc0e22faed63 +0 -0
- data/test/dummy/tmp/cache/assets/D13/FE0/sprockets%2Ffb7916af38b70bb578a6d035d2508f18 +0 -0
- data/test/dummy/tmp/cache/assets/D24/8D0/sprockets%2F8f2a1bfe27153639fb959a5968b44c8d +0 -0
- data/test/dummy/tmp/cache/assets/D2A/F60/sprockets%2Fe73a58b43837c7ff9f6543898b362ebb +0 -0
- data/test/dummy/tmp/cache/assets/D2C/800/sprockets%2Fc7dacf6709ba20274c032814cd4e531b +0 -0
- data/test/dummy/tmp/cache/assets/D2F/AF0/sprockets%2F701a5254fb5ba1455e860e5c70d07cdb +0 -0
- data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
- data/test/dummy/tmp/cache/assets/D3B/4F0/sprockets%2F6be6ae7be6be4167064d435a34ca1369 +0 -0
- data/test/dummy/tmp/cache/assets/D3E/150/sprockets%2Fec3ae7fd44729124d3e7046f33af28a4 +0 -0
- data/test/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
- data/test/dummy/tmp/cache/assets/D4D/D70/sprockets%2F169a66ca31e9576ce9062c9c38bf5e2e +0 -0
- data/test/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
- data/test/dummy/tmp/cache/assets/D64/2C0/sprockets%2Fce4f2416932b7aae7c1e2cdad1343873 +0 -0
- data/test/dummy/tmp/cache/assets/D6D/830/sprockets%2Fae3018f4cb13ce743eecf52ff7951532 +0 -0
- data/test/dummy/tmp/cache/assets/D75/FD0/sprockets%2Fc7cfc0d19e8f7f5166a4b436ba358e34 +0 -0
- data/test/dummy/tmp/cache/assets/D86/680/sprockets%2F16dbbba0db91ea56e2a6a5f6450c2522 +0 -0
- data/test/dummy/tmp/cache/assets/D91/A70/sprockets%2F4bc82aa15ade4213e6574aaac1d8387f +0 -0
- data/test/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
- data/test/dummy/tmp/cache/assets/DA3/140/sprockets%2Fbdcfc2e11e8ef8080de86623e8734ad2 +0 -0
- data/test/dummy/tmp/cache/assets/DBA/330/sprockets%2Fc80aa22f501364dfa9cbf2b4135efbc4 +0 -0
- data/test/dummy/tmp/cache/assets/DCE/D20/sprockets%2Fbb2839e538aadcf1cacde890159b37e2 +0 -0
- data/test/dummy/tmp/cache/assets/DD0/820/sprockets%2F92503cd8fdbce38ac5de45630df9d15b +0 -0
- data/test/dummy/tmp/cache/assets/DD2/350/sprockets%2Ffabdac3a31a0fd1f9132ff5e89f46993 +0 -0
- data/test/dummy/tmp/cache/assets/DD9/760/sprockets%2F96b2c42e56df91c925faff94d3dbfb32 +0 -0
- data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
- data/test/dummy/tmp/cache/assets/DE5/ED0/sprockets%2Fbceb64af6e2b030cc2362a481efae2d2 +0 -0
- data/test/dummy/tmp/cache/assets/DF5/940/sprockets%2F68a03b5cb8fac91ac7bb6f7a3703d5ae +0 -0
- data/test/dummy/tmp/cache/assets/DFE/710/sprockets%2Fbaba2fa1e1be8d768b866fc59c8b250c +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_animation.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_appearance.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-image.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_background-size.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-image.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_border-radius.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-shadow.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_box-sizing.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_columns.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_flex-box.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_inline-block.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_linear-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_radial-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transform.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_transition.scssc +0 -0
- data/test/dummy/tmp/cache/sass/11e515356bc5cb9773a810e4d1a8f0adc86f5a55/_user-select.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_blank_slates.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_breadcrumbs.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_buttons.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_columns.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_grid.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_links.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_pagination.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_panels.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_scopes.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_status_tags.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_table_tools.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/56f95d233a346715dafb1425c7f414577b3d6faa/_tables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_button.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_clearfix.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_font-family.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_html5-input-types.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_position.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6013972b9ab0cd5761b527297d1ebb87580f0630/_timing-functions.scssc +0 -0
- data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_dashboard.scssc +0 -0
- data/test/dummy/tmp/cache/sass/649eb811547a5926cdeb483c470efd70480ac80c/_logged_out.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_footer.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_main_structure.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6918b4b0c0893eabd3eaf41fe8db1fb76432cdb7/_title_bar.scssc +0 -0
- data/test/dummy/tmp/cache/sass/6b007881be7ebec964704521003b1d386a87a62e/active_admin.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_deprecated-webkit-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_flex-grid.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_grid-width.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_linear-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_modular-scale.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_radial-gradient.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_render-gradients.scssc +0 -0
- data/test/dummy/tmp/cache/sass/888027b357ba8ec167989a2ba7b1e1313066ae81/_tint-shade.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9281732a5ed473e2068958b0e7f25e8bbdf281c1/_bourbon.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_all.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_shadows.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_typography.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ba7a563e935ca29470253023d07bc597fa6926a3/_variables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/e1ee1d106b06fec6178a485c63d8daecda888171/_typography.css.scssc +0 -0
- data/test/test_helper.rb +15 -0
- metadata +454 -0
@@ -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,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,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,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,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,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
|