rich 0.0.1
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.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +163 -0
- data/Rakefile +39 -0
- data/app/assets/images/rich/images.png +0 -0
- data/app/assets/images/rich/plus-red.png +0 -0
- data/app/assets/images/rich/plus.png +0 -0
- data/app/assets/images/rich/x-red.png +0 -0
- data/app/assets/javascripts/rich/application.js +61 -0
- data/app/assets/javascripts/rich/base.js +51 -0
- data/app/assets/javascripts/rich/ckeditor_path.js +1 -0
- data/app/assets/javascripts/rich/uploader.js +59 -0
- data/app/assets/stylesheets/rich/application.css.scss +253 -0
- data/app/assets/stylesheets/rich/editor.css +20 -0
- data/app/assets/stylesheets/rich/files.css +4 -0
- data/app/assets/stylesheets/rich/mixins/reset.css.scss +58 -0
- data/app/controllers/rich/application_controller.rb +11 -0
- data/app/controllers/rich/files_controller.rb +107 -0
- data/app/helpers/rich/application_helper.rb +4 -0
- data/app/helpers/rich/files_helper.rb +4 -0
- data/app/inputs/rich_input.rb +14 -0
- data/app/models/rich/rich_image.rb +77 -0
- data/app/views/layouts/rich/application.html.erb +14 -0
- data/app/views/rich/files/_image.html.erb +9 -0
- data/app/views/rich/files/destroy.js.erb +1 -0
- data/app/views/rich/files/index.html.erb +29 -0
- data/app/views/rich/files/show.html.erb +1 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20111002142937_create_rich_rich_images.rb +17 -0
- data/lib/generators/rich/install/install_generator.rb +34 -0
- data/lib/generators/rich/install/templates/rich.js +1 -0
- data/lib/generators/rich/install/templates/rich.rb.erb +69 -0
- data/lib/rich.rb +63 -0
- data/lib/rich/engine.rb +13 -0
- data/lib/rich/form_builder.rb +14 -0
- data/lib/rich/legacy_formtastic.rb +15 -0
- data/lib/rich/version.rb +3 -0
- data/lib/rich/view_helper.rb +48 -0
- data/lib/tasks/rich_tasks.rake +29 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/admin/dashboards.rb +38 -0
- data/test/dummy/app/admin/posts.rb +11 -0
- data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/javascripts/posts.js +2 -0
- data/test/dummy/app/assets/javascripts/rich.js +1 -0
- data/test/dummy/app/assets/stylesheets/active_admin.css.scss +10 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/assets/stylesheets/posts.css +4 -0
- data/test/dummy/app/assets/stylesheets/rich/editor.css +20 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/posts_controller.rb +83 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/posts_helper.rb +2 -0
- data/test/dummy/app/models/admin_user.rb +9 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/_form.html.erb +29 -0
- data/test/dummy/app/views/posts/_formtastic_form.html.erb +10 -0
- data/test/dummy/app/views/posts/edit.html.erb +6 -0
- data/test/dummy/app/views/posts/index.html.erb +27 -0
- data/test/dummy/app/views/posts/new.html.erb +5 -0
- data/test/dummy/app/views/posts/show.html.erb +20 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +48 -0
- data/test/dummy/config/boot.rb +19 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +32 -0
- data/test/dummy/config/environments/production.rb +62 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/active_admin.rb +102 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +211 -0
- data/test/dummy/config/initializers/formtastic.rb +80 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/rich.rb +28 -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 +58 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +13 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20111001122048_create_posts.rb +11 -0
- data/test/dummy/db/migrate/20111003150957_create_rich_rich_images.rb +17 -0
- data/test/dummy/db/migrate/20111014123344_devise_create_admin_users.rb +31 -0
- data/test/dummy/db/migrate/20111014143348_create_admin_notes.rb +16 -0
- data/test/dummy/db/migrate/20111014143349_move_admin_notes_to_comments.rb +25 -0
- data/test/dummy/db/production.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +67 -0
- data/test/dummy/log/development.log +72064 -0
- data/test/dummy/log/production.log +2417 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/system/test +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/admin_users.yml +11 -0
- data/test/dummy/test/fixtures/posts.yml +11 -0
- data/test/dummy/test/functional/posts_controller_test.rb +49 -0
- data/test/dummy/test/unit/admin_user_test.rb +7 -0
- data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/dummy/test/unit/post_test.rb +7 -0
- data/test/dummy/tmp/cache/assets/C2B/5B0/sprockets%2F0c71315129cf9540624929678219ee7b +0 -0
- data/test/dummy/tmp/cache/assets/C32/C40/sprockets%2Ff459d7671964c49e413971720514ba68 +0 -0
- data/test/dummy/tmp/cache/assets/C51/3D0/sprockets%2F110c288a88ab99a1399d35171079612c +0 -0
- data/test/dummy/tmp/cache/assets/C53/630/sprockets%2F0680b1b2c967d3c84970e3786800641c +0 -0
- data/test/dummy/tmp/cache/assets/C53/680/sprockets%2F03d11661470de7443c495783330d9ee7 +0 -0
- data/test/dummy/tmp/cache/assets/C7F/C10/sprockets%2F356f0929a286c961448d76c12a2e14b1 +0 -0
- data/test/dummy/tmp/cache/assets/C8D/E30/sprockets%2F24444bdc865de860f4b693233c973844 +0 -0
- data/test/dummy/tmp/cache/assets/C99/430/sprockets%2F1027b261dc3bd6202585ad4d830263c6 +0 -0
- data/test/dummy/tmp/cache/assets/CAB/440/sprockets%2Fed2218494b3b8488b7268c00e717a0c1 +0 -0
- data/test/dummy/tmp/cache/assets/CB3/920/sprockets%2Fc38c48651c972cee0be83538700535b4 +0 -0
- data/test/dummy/tmp/cache/assets/CB4/740/sprockets%2F36fd3817633b234824bc6577f25ffe01 +0 -0
- data/test/dummy/tmp/cache/assets/CBE/A80/sprockets%2F60bb9087aed9745744925f6ce01525d9 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/040/sprockets%2F83a9f5f7314b761bbd7f1858d1998045 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/590/sprockets%2F869369b5c848f745b23ba174ca9197a6 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/BF0/sprockets%2F93d5b131135a09e48369e02ba5c01b0a +0 -0
- data/test/dummy/tmp/cache/assets/CC7/5F0/sprockets%2F8bf37168fb70e08b9e4578e72739a543 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/340/sprockets%2Fae698307143f445c5011d6ad90b4cf60 +0 -0
- data/test/dummy/tmp/cache/assets/CDD/D50/sprockets%2Faee2002e4369cf20946112efcb776089 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/510/sprockets%2F3271d0cbd86553a56768f4d130ec5e59 +0 -0
- data/test/dummy/tmp/cache/assets/CE8/310/sprockets%2F4ab24984d5862f28160f1f4f067e2ef4 +0 -0
- data/test/dummy/tmp/cache/assets/CEC/1A0/sprockets%2F87fdead6014b961bb870b5931890d677 +0 -0
- data/test/dummy/tmp/cache/assets/CED/2E0/sprockets%2F82382552d084b0569dfd88e34d1cb7e8 +0 -0
- data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/test/dummy/tmp/cache/assets/CF0/A80/sprockets%2Fd1de761043f6d817880d4b876a73bf87 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/EC0/sprockets%2F04ba1f02c639d30c53eb7b51640b937a +0 -0
- data/test/dummy/tmp/cache/assets/CFB/870/sprockets%2Feb5658a4a2c12e389e4c405f0113a0a7 +0 -0
- data/test/dummy/tmp/cache/assets/D00/7A0/sprockets%2F3ee0dfa5072b54505817cb4bf934201e +0 -0
- data/test/dummy/tmp/cache/assets/D00/C00/sprockets%2F0a61e8d7b11a463083da24605e65d5dd +0 -0
- data/test/dummy/tmp/cache/assets/D07/B30/sprockets%2F0640b99ec5e303921065ac4c0ff8b7f0 +0 -0
- data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
- data/test/dummy/tmp/cache/assets/D13/970/sprockets%2F1fd634278255bc58382a590fd5cf24cc +0 -0
- data/test/dummy/tmp/cache/assets/D14/980/sprockets%2F85dc72862eb259cd954ab41369bc6a32 +0 -0
- data/test/dummy/tmp/cache/assets/D15/F40/sprockets%2F83d1a8006e470e79f75592d63bdedc04 +0 -0
- data/test/dummy/tmp/cache/assets/D16/C70/sprockets%2Fd3046a8979c64b4311a728da2ee8b88b +0 -0
- data/test/dummy/tmp/cache/assets/D1D/1A0/sprockets%2Fc2e11e4152a31726c2cbab7333c74ba2 +0 -0
- data/test/dummy/tmp/cache/assets/D1D/500/sprockets%2F71e1de34b5d39e4c637f0fb0619696f7 +0 -0
- data/test/dummy/tmp/cache/assets/D1F/B30/sprockets%2F6351ed750b17ed0f99fa01c32ff98878 +0 -0
- data/test/dummy/tmp/cache/assets/D2A/FA0/sprockets%2Fa5403e1fe15018cddc4435c3cac84910 +0 -0
- data/test/dummy/tmp/cache/assets/D2E/090/sprockets%2Fc54283e81ce52bf9d542ab12492a01ad +0 -0
- data/test/dummy/tmp/cache/assets/D2F/390/sprockets%2Fa02968dd653b0e650fc202c33ff42fc0 +0 -0
- data/test/dummy/tmp/cache/assets/D30/E90/sprockets%2F3a19bbe0320337a6bf29177da71bf1e7 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D34/080/sprockets%2Fe398005214c8d65a54fc19fca2c00c8b +0 -0
- data/test/dummy/tmp/cache/assets/D37/9B0/sprockets%2F0de49dd3031c50c7cf2ef74d6c392530 +0 -0
- data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
- data/test/dummy/tmp/cache/assets/D3C/070/sprockets%2F2377eb8a729535e35abd593a6fc00ba6 +0 -0
- data/test/dummy/tmp/cache/assets/D3E/B20/sprockets%2F1f79ee84bd6d74d100c5cb018b662b67 +0 -0
- data/test/dummy/tmp/cache/assets/D40/A40/sprockets%2Feb59c65dcb7136f1cd134dac36794822 +0 -0
- data/test/dummy/tmp/cache/assets/D48/9F0/sprockets%2F6ed3c460867ee6d748edad50818d332a +0 -0
- data/test/dummy/tmp/cache/assets/D4D/650/sprockets%2Ff51d1875ad5829c7bf3ff03e920497be +0 -0
- data/test/dummy/tmp/cache/assets/D52/9B0/sprockets%2F736738bf59f956eb15c4bff06d980be0 +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/test/dummy/tmp/cache/assets/D55/5C0/sprockets%2F97b52c1c0d1a002ac6fb9d702b7ab625 +0 -0
- data/test/dummy/tmp/cache/assets/D61/940/sprockets%2Fca03651b8f5fb1416c9945cda71ab22d +0 -0
- data/test/dummy/tmp/cache/assets/D6C/F90/sprockets%2Fcb34e531e41b981cf6ca2a5c7e70f890 +0 -0
- data/test/dummy/tmp/cache/assets/D78/9D0/sprockets%2Ff56eced46698105ad2e9d46b1e2ee228 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D86/710/sprockets%2F409dbeb796f68c91b60fe29aef7817e3 +0 -0
- data/test/dummy/tmp/cache/assets/D95/D50/sprockets%2F15e32d81de6597aad23d67d2cd1d0b7a +0 -0
- data/test/dummy/tmp/cache/assets/D96/E90/sprockets%2Ff43f31dd3e2d9f8eda108c01c42bd457 +0 -0
- data/test/dummy/tmp/cache/assets/D98/BF0/sprockets%2F132c8dc4d7ba67c8faee429e5064a02c +0 -0
- data/test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/test/dummy/tmp/cache/assets/DB9/240/sprockets%2F689d916cf738bdb67e176fced176e3af +0 -0
- data/test/dummy/tmp/cache/assets/DBA/AB0/sprockets%2F8be4208fd77cb5ef9b6f77e5fcf18670 +0 -0
- data/test/dummy/tmp/cache/assets/DC5/450/sprockets%2F82d256faac73d9a3ec5c4f1d11be525d +0 -0
- data/test/dummy/tmp/cache/assets/DC6/890/sprockets%2F41b80fcec0c085408c41ecadc877df0f +0 -0
- data/test/dummy/tmp/cache/assets/DCE/890/sprockets%2Ffd6332ebff4dab12cdf448e195d6b381 +0 -0
- data/test/dummy/tmp/cache/assets/DD7/B50/sprockets%2F7effa89c4b23ab60109f969a9a66ccbc +0 -0
- data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
- data/test/dummy/tmp/cache/assets/DE7/7C0/sprockets%2F75aa5c034633c20d9c4d1bffbbbdc23d +0 -0
- data/test/dummy/tmp/cache/assets/DF0/680/sprockets%2F5e8210564bdda6fcef1fa19aa04b5e6a +0 -0
- data/test/dummy/tmp/cache/assets/DFB/0C0/sprockets%2Fd35f36529da4a7a4cf67cdbe0a3bf27e +0 -0
- data/test/dummy/tmp/cache/assets/DFF/4D0/sprockets%2F0d7eae306cc4e83ae549e96b1b6da8db +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E06/920/sprockets%2F6baa37d1c26468aef4fe5fe4bf982fa3 +0 -0
- data/test/dummy/tmp/cache/assets/E09/680/sprockets%2Fff9edf3a74399a0818b02efcff3ad0f7 +0 -0
- data/test/dummy/tmp/cache/assets/E0B/8B0/sprockets%2F35f64adcaf8786c81c0def5dd2ff47d3 +0 -0
- data/test/dummy/tmp/cache/assets/E2F/E90/sprockets%2Ff4b19e42c92a93dcaaec9fe6eae4081d +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_typography.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_typography.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4905b1148d31ac1351d8ccf185fbd2494a596795/application.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_tables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_all.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_shadows.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_variables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9b29130c260e464c0ad2c23c77a58da7c3f9eec7/active_admin.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_all.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_shadows.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_variables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ddba83cb438190ca32bf384b6eea0c3ef82ae9fa/reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_tables.css.scssc +0 -0
- data/test/fixtures/rich/rich_images.yml +11 -0
- data/test/functional/rich/files_controller_test.rb +9 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/rich_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- data/test/unit/helpers/rich/files_helper_test.rb +6 -0
- data/test/unit/rich/rich_image_test.rb +9 -0
- metadata +603 -0
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<%= form_for(@post) do |f| %>
|
|
2
|
+
<% if @post.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% @post.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 :name %><br />
|
|
16
|
+
<%= f.text_field :name %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="field">
|
|
19
|
+
<%= f.label :title %><br />
|
|
20
|
+
<%= f.text_field :title %>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="field">
|
|
23
|
+
<%= f.label :content %><br />
|
|
24
|
+
<%= f.rich_text_area :content, :editor => { } %>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="actions">
|
|
27
|
+
<%= f.submit %>
|
|
28
|
+
</div>
|
|
29
|
+
<% end %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<h1>Listing posts</h1>
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Name</th>
|
|
6
|
+
<th>Title</th>
|
|
7
|
+
<th>Content</th>
|
|
8
|
+
<th></th>
|
|
9
|
+
<th></th>
|
|
10
|
+
<th></th>
|
|
11
|
+
</tr>
|
|
12
|
+
|
|
13
|
+
<% @posts.each do |post| %>
|
|
14
|
+
<tr>
|
|
15
|
+
<td><%= post.id %></td>
|
|
16
|
+
<td><%= post.name %></td>
|
|
17
|
+
<td><%= post.title %></td>
|
|
18
|
+
<td><%= link_to 'Show', post %></td>
|
|
19
|
+
<td><%= link_to 'Edit', edit_post_path(post) %></td>
|
|
20
|
+
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
|
|
21
|
+
</tr>
|
|
22
|
+
<% end %>
|
|
23
|
+
</table>
|
|
24
|
+
|
|
25
|
+
<br />
|
|
26
|
+
|
|
27
|
+
<%= link_to 'New Post', new_post_path %>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<b>Name:</b>
|
|
5
|
+
<%= @post.name %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<b>Title:</b>
|
|
10
|
+
<%= @post.title %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<b>Content:</b>
|
|
15
|
+
<%= raw(@post.content) %>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<%= link_to 'Edit', edit_post_path(@post) %> |
|
|
20
|
+
<%= link_to 'Back', posts_path %>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'rails/all'
|
|
4
|
+
|
|
5
|
+
if defined?(Bundler)
|
|
6
|
+
# If you precompile assets before deploying to production, use this line
|
|
7
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
|
8
|
+
# If you want your assets lazily compiled in production, use this line
|
|
9
|
+
# Bundler.require(:default, :assets, Rails.env)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
module Dummy
|
|
13
|
+
class Application < Rails::Application
|
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
15
|
+
# Application configuration should go into files in config/initializers
|
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
17
|
+
|
|
18
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
|
19
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
|
20
|
+
|
|
21
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
22
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
23
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
24
|
+
|
|
25
|
+
# Activate observers that should always be running.
|
|
26
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
27
|
+
|
|
28
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
29
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
30
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
|
31
|
+
|
|
32
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
33
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
34
|
+
# config.i18n.default_locale = :de
|
|
35
|
+
|
|
36
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
|
37
|
+
config.encoding = "utf-8"
|
|
38
|
+
|
|
39
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
|
40
|
+
config.filter_parameters += [:password]
|
|
41
|
+
|
|
42
|
+
# Enable the asset pipeline
|
|
43
|
+
config.assets.enabled = true
|
|
44
|
+
|
|
45
|
+
# Version of your assets, change this if you want to expire all your assets
|
|
46
|
+
config.assets.version = '1.0'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# require 'rubygems'
|
|
2
|
+
#
|
|
3
|
+
# # Set up gems listed in the Gemfile.
|
|
4
|
+
# ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
|
5
|
+
#
|
|
6
|
+
# require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
|
7
|
+
#
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
require 'rubygems'
|
|
11
|
+
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
|
|
12
|
+
|
|
13
|
+
if File.exist?(gemfile)
|
|
14
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
15
|
+
require 'bundler'
|
|
16
|
+
Bundler.setup
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
$:.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/development.sqlite3
|
|
24
|
+
pool: 5
|
|
25
|
+
timeout: 5000
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
# Do not compress assets
|
|
26
|
+
config.assets.compress = false
|
|
27
|
+
|
|
28
|
+
# Expands the lines which load the assets
|
|
29
|
+
config.assets.debug = true
|
|
30
|
+
|
|
31
|
+
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
|
|
32
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
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 = true
|
|
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 = true
|
|
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
|
+
config.assets.initialize_on_precompile = false
|
|
24
|
+
|
|
25
|
+
# Defaults to Rails.root.join("public/assets")
|
|
26
|
+
# config.assets.manifest = YOUR_PATH
|
|
27
|
+
|
|
28
|
+
# Specifies the header that your server uses for sending files
|
|
29
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
30
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
31
|
+
|
|
32
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
33
|
+
# config.force_ssl = true
|
|
34
|
+
|
|
35
|
+
# See everything in the log (default is :info)
|
|
36
|
+
# config.log_level = :debug
|
|
37
|
+
|
|
38
|
+
# Use a different logger for distributed setups
|
|
39
|
+
# config.logger = SyslogLogger.new
|
|
40
|
+
|
|
41
|
+
# Use a different cache store in production
|
|
42
|
+
# config.cache_store = :mem_cache_store
|
|
43
|
+
|
|
44
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
|
45
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
46
|
+
|
|
47
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
|
48
|
+
config.assets.precompile += %w( search.js )
|
|
49
|
+
|
|
50
|
+
# Disable delivery errors, bad email addresses will be ignored
|
|
51
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
52
|
+
|
|
53
|
+
# Enable threaded mode
|
|
54
|
+
# config.threadsafe!
|
|
55
|
+
|
|
56
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
57
|
+
# the I18n.default_locale when a translation can not be found)
|
|
58
|
+
config.i18n.fallbacks = true
|
|
59
|
+
|
|
60
|
+
# Send deprecation notices to registered listeners
|
|
61
|
+
config.active_support.deprecation = :notify
|
|
62
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
33
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
34
|
+
# like if you have constraints or database-specific column types
|
|
35
|
+
# config.active_record.schema_format = :sql
|
|
36
|
+
|
|
37
|
+
# Print deprecation notices to the stderr
|
|
38
|
+
config.active_support.deprecation = :stderr
|
|
39
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
|
|
11
|
+
# == Default Namespace
|
|
12
|
+
#
|
|
13
|
+
# Set the default namespace each administration resource
|
|
14
|
+
# will be added to.
|
|
15
|
+
#
|
|
16
|
+
# eg:
|
|
17
|
+
# config.default_namespace = :hello_world
|
|
18
|
+
#
|
|
19
|
+
# This will create resources in the HelloWorld module and
|
|
20
|
+
# will namespace routes to /hello_world/*
|
|
21
|
+
#
|
|
22
|
+
# To set no namespace by default, use:
|
|
23
|
+
# config.default_namespace = false
|
|
24
|
+
#
|
|
25
|
+
# Default:
|
|
26
|
+
# config.default_namespace = :admin
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# == User Authentication
|
|
30
|
+
#
|
|
31
|
+
# Active Admin will automatically call an authentication
|
|
32
|
+
# method in a before filter of all controller actions to
|
|
33
|
+
# ensure that there is a currently logged in admin user.
|
|
34
|
+
#
|
|
35
|
+
# This setting changes the method which Active Admin calls
|
|
36
|
+
# within the controller.
|
|
37
|
+
config.authentication_method = :authenticate_admin_user!
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# == Current User
|
|
41
|
+
#
|
|
42
|
+
# Active Admin will associate actions with the current
|
|
43
|
+
# user performing them.
|
|
44
|
+
#
|
|
45
|
+
# This setting changes the method which Active Admin calls
|
|
46
|
+
# to return the currently logged in user.
|
|
47
|
+
config.current_user_method = :current_admin_user
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# == Logging Out
|
|
51
|
+
#
|
|
52
|
+
# Active Admin displays a logout link on each screen. These
|
|
53
|
+
# settings configure the location and method used for the link.
|
|
54
|
+
#
|
|
55
|
+
# This setting changes the path where the link points to. If it's
|
|
56
|
+
# a string, the strings is used as the path. If it's a Symbol, we
|
|
57
|
+
# will call the method to return the path.
|
|
58
|
+
#
|
|
59
|
+
# Default:
|
|
60
|
+
# config.logout_link_path = :destroy_admin_user_session_path
|
|
61
|
+
|
|
62
|
+
# This setting changes the http method used when rendering the
|
|
63
|
+
# link. For example :get, :delete, :put, etc..
|
|
64
|
+
#
|
|
65
|
+
# Default:
|
|
66
|
+
# config.logout_link_method = :get
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# == Admin Comments
|
|
70
|
+
#
|
|
71
|
+
# Admin comments allow you to add comments to any model for admin use
|
|
72
|
+
#
|
|
73
|
+
# Admin comments are enabled by default in the default
|
|
74
|
+
# namespace only. You can turn them on in a namesapce
|
|
75
|
+
# by adding them to the comments array.
|
|
76
|
+
#
|
|
77
|
+
# Default:
|
|
78
|
+
# config.allow_comments_in = [:admin]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# == Controller Filters
|
|
82
|
+
#
|
|
83
|
+
# You can add before, after and around filters to all of your
|
|
84
|
+
# Active Admin resources from here.
|
|
85
|
+
#
|
|
86
|
+
# config.before_filter :do_something_awesome
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# == Register Stylesheets & Javascripts
|
|
90
|
+
#
|
|
91
|
+
# We recommend using the built in Active Admin layout and loading
|
|
92
|
+
# up your own stylesheets / javascripts to customize the look
|
|
93
|
+
# and feel.
|
|
94
|
+
#
|
|
95
|
+
# To load a stylesheet:
|
|
96
|
+
# config.register_stylesheet 'my_stylesheet.css'
|
|
97
|
+
#
|
|
98
|
+
# To load a javascript file:
|
|
99
|
+
# config.register_javascript 'my_javascript.js'
|
|
100
|
+
config.register_javascript 'rich/base.js'
|
|
101
|
+
|
|
102
|
+
end
|