activeadmin-mongoid 0.0.2.jpmckinney.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -4
  3. data/.rspec +2 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +27 -1
  6. data/README.md +0 -5
  7. data/Rakefile +6 -1
  8. data/activeadmin-mongoid.gemspec +8 -4
  9. data/lib/active_admin/mongoid.rb +26 -17
  10. data/lib/active_admin/mongoid/adaptor.rb +65 -0
  11. data/lib/active_admin/mongoid/comments.rb +12 -5
  12. data/lib/active_admin/mongoid/criteria.rb +10 -0
  13. data/lib/active_admin/mongoid/document.rb +43 -2
  14. data/lib/active_admin/mongoid/filter_form_builder.rb +31 -0
  15. data/lib/active_admin/mongoid/generators/install.rb +7 -0
  16. data/lib/active_admin/mongoid/helpers/collection.rb +10 -0
  17. data/lib/active_admin/mongoid/resource.rb +51 -33
  18. data/lib/active_admin/mongoid/version.rb +1 -1
  19. data/lib/tasks/activeadmin-mongoid_tasks.rake +4 -0
  20. data/spec/features/smoke_spec.rb +60 -0
  21. data/spec/spec_helper.rb +42 -0
  22. data/spec/support/capybara.rb +1 -0
  23. data/tasks/js.rake +32 -0
  24. data/tasks/test.rake +75 -0
  25. data/test_app/.gitignore +15 -0
  26. data/test_app/.rspec +1 -0
  27. data/test_app/README.rdoc +261 -0
  28. data/test_app/Rakefile +7 -0
  29. data/test_app/app/admin/admin_users.rb +20 -0
  30. data/test_app/app/admin/dashboard.rb +33 -0
  31. data/test_app/app/admin/posts.rb +3 -0
  32. data/test_app/app/assets/images/rails.png +0 -0
  33. data/test_app/app/assets/javascripts/active_admin.js +1 -0
  34. data/test_app/app/assets/javascripts/application.js +15 -0
  35. data/test_app/app/assets/stylesheets/active_admin.css.scss +29 -0
  36. data/test_app/app/assets/stylesheets/application.css +13 -0
  37. data/test_app/app/controllers/application_controller.rb +3 -0
  38. data/test_app/app/helpers/application_helper.rb +2 -0
  39. data/test_app/app/mailers/.gitkeep +0 -0
  40. data/test_app/app/models/.gitkeep +0 -0
  41. data/test_app/app/models/admin_user.rb +40 -0
  42. data/test_app/app/models/post.rb +6 -0
  43. data/test_app/app/views/layouts/application.html.erb +14 -0
  44. data/test_app/config.ru +4 -0
  45. data/test_app/config/_link_mongoid_config.rb +7 -0
  46. data/test_app/config/application.rb +70 -0
  47. data/test_app/config/boot.rb +6 -0
  48. data/test_app/config/database.yml +25 -0
  49. data/test_app/config/environment.rb +5 -0
  50. data/test_app/config/environments/development.rb +31 -0
  51. data/test_app/config/environments/production.rb +64 -0
  52. data/test_app/config/environments/test.rb +35 -0
  53. data/test_app/config/initializers/active_admin.rb +210 -0
  54. data/test_app/config/initializers/backtrace_silencers.rb +7 -0
  55. data/test_app/config/initializers/devise.rb +246 -0
  56. data/test_app/config/initializers/inflections.rb +15 -0
  57. data/test_app/config/initializers/mime_types.rb +5 -0
  58. data/test_app/config/initializers/secret_token.rb +7 -0
  59. data/test_app/config/initializers/session_store.rb +8 -0
  60. data/test_app/config/initializers/wrap_parameters.rb +10 -0
  61. data/test_app/config/locales/devise.en.yml +59 -0
  62. data/test_app/config/locales/en.yml +5 -0
  63. data/test_app/config/mongoid.2.yml +20 -0
  64. data/test_app/config/mongoid.3.yml +96 -0
  65. data/test_app/config/routes.rb +4 -0
  66. data/test_app/db/migrate/20130514223107_create_admin_notes.rb +17 -0
  67. data/test_app/db/migrate/20130514223108_move_admin_notes_to_comments.rb +26 -0
  68. data/test_app/db/seeds.rb +7 -0
  69. data/test_app/lib/assets/.gitkeep +0 -0
  70. data/test_app/lib/tasks/.gitkeep +0 -0
  71. data/test_app/log/.gitkeep +0 -0
  72. data/test_app/public/404.html +26 -0
  73. data/test_app/public/422.html +26 -0
  74. data/test_app/public/500.html +25 -0
  75. data/test_app/public/favicon.ico +0 -0
  76. data/test_app/public/index.html +241 -0
  77. data/test_app/public/robots.txt +5 -0
  78. data/test_app/script/rails +6 -0
  79. data/test_app/spec/models/admin_user_spec.rb +5 -0
  80. data/test_app/test/fixtures/.gitkeep +0 -0
  81. data/test_app/test/functional/.gitkeep +0 -0
  82. data/test_app/test/integration/.gitkeep +0 -0
  83. data/test_app/test/performance/browsing_test.rb +12 -0
  84. data/test_app/test/test_helper.rb +7 -0
  85. data/test_app/test/unit/.gitkeep +0 -0
  86. data/test_app/vendor/assets/javascripts/.gitkeep +0 -0
  87. data/test_app/vendor/assets/stylesheets/.gitkeep +0 -0
  88. data/test_app/vendor/plugins/.gitkeep +0 -0
  89. metadata +136 -29
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ TestApp::Application.config.secret_token = 'cf01167eb0aadec246c04639d4a06ec356f5ae9ef6a3c908d7324a68b230bbdaad30d8eafc42329505066db19acc1c8a493157e11837c3553333abd89c5eb7be'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ TestApp::Application.config.session_store :cookie_store, key: '_test_app_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # TestApp::Application.config.session_store :active_record_store
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed. You are now signed in."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account was not activated yet."
12
+ invalid: "Invalid email or password."
13
+ invalid_token: "Invalid authentication token."
14
+ locked: "Your account is locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired, please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,20 @@
1
+ development:
2
+ host: localhost
3
+ database: test_app_development
4
+
5
+ test:
6
+ host: localhost
7
+ database: test_app_test
8
+
9
+ # set these environment variables on your prod server
10
+ production:
11
+ host: <%= ENV['MONGOID_HOST'] %>
12
+ port: <%= ENV['MONGOID_PORT'] %>
13
+ username: <%= ENV['MONGOID_USERNAME'] %>
14
+ password: <%= ENV['MONGOID_PASSWORD'] %>
15
+ database: <%= ENV['MONGOID_DATABASE'] %>
16
+ # slaves:
17
+ # - host: slave1.local
18
+ # port: 27018
19
+ # - host: slave2.local
20
+ # port: 27019
@@ -0,0 +1,96 @@
1
+ test:
2
+ # Configure available database sessions. (required)
3
+ sessions:
4
+ # Defines the default session. (required)
5
+ default:
6
+ # Defines the name of the default database that Mongoid can connect to.
7
+ # (required).
8
+ database: activeadmin_mongoid_test
9
+ # Provides the hosts the default session can connect to. Must be an array
10
+ # of host:port pairs. (required)
11
+ hosts:
12
+ - localhost:27017
13
+ options:
14
+ # Change whether the session persists in safe mode by default.
15
+ # (default: false)
16
+ # safe: false
17
+
18
+ # Change the default consistency model to :eventual or :strong.
19
+ # :eventual will send reads to secondaries, :strong sends everything
20
+ # to master. (default: :eventual)
21
+ # consistency: :eventual
22
+
23
+ # How many times Moped should attempt to retry an operation after
24
+ # failure. (default: 30)
25
+ # max_retries: 30
26
+
27
+ # The time in seconds that Moped should wait before retrying an
28
+ # operation on failure. (default: 1)
29
+ # retry_interval: 1
30
+ # Configure Mongoid specific options. (optional)
31
+ options: &default_options
32
+ # Configuration for whether or not to allow access to fields that do
33
+ # not have a field definition on the model. (default: true)
34
+ # allow_dynamic_fields: true
35
+ allow_dynamic_fields: false
36
+
37
+ # Enable the identity map, needed for eager loading. (default: false)
38
+ # identity_map_enabled: false
39
+ identity_map_enabled: true
40
+
41
+ # Includes the root model name in json serialization. (default: false)
42
+ # include_root_in_json: false
43
+
44
+ # Include the _type field in serializaion. (default: false)
45
+ # include_type_for_serialization: false
46
+
47
+ # Preload all models in development, needed when models use
48
+ # inheritance. (default: false)
49
+ # preload_models: false
50
+
51
+ # Protect id and type from mass assignment. (default: true)
52
+ # protect_sensitive_fields: true
53
+
54
+ # Raise an error when performing a #find and the document is not found.
55
+ # (default: true)
56
+ # raise_not_found_error: true
57
+
58
+ # Raise an error when defining a scope with the same name as an
59
+ # existing method. (default: false)
60
+ scope_overwrite_exception: true
61
+
62
+ # Skip the database version check, used when connecting to a db without
63
+ # admin access. (default: false)
64
+ # skip_version_check: false
65
+
66
+ # User Active Support's time zone in conversions. (default: true)
67
+ # use_activesupport_time_zone: true
68
+
69
+ # Ensure all times are UTC in the app side. (default: false)
70
+ # use_utc: false
71
+
72
+ # production:
73
+ # sessions:
74
+ # default:
75
+ # uri: <%= ENV['MONGOLAB_URI'] %>
76
+ # options:
77
+ # skip_version_check: true
78
+ # identity_map_enabled: true
79
+ # safe: true
80
+ # options:
81
+ # *default_options
82
+ #
83
+ # development:
84
+ # sessions:
85
+ # default:
86
+ # database: activeadmin_mongoid_development
87
+ # hosts:
88
+ # - localhost:27017
89
+ # options:
90
+ # consistency: :strong
91
+ # # In the test environment we lower the retries and retry interval to
92
+ # # low amounts for fast failures.
93
+ # max_retries: 1
94
+ # retry_interval: 0
95
+ # options:
96
+ # *default_options
@@ -0,0 +1,4 @@
1
+ TestApp::Application.routes.draw do
2
+ devise_for :admin_users, ActiveAdmin::Devise.config
3
+ ActiveAdmin.routes(self)
4
+ end
@@ -0,0 +1,17 @@
1
+ class CreateAdminNotes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :admin_notes do |t|
4
+ t.string :resource_id, :null => false
5
+ t.string :resource_type, :null => false
6
+ t.references :admin_user, :polymorphic => true
7
+ t.text :body
8
+ t.timestamps
9
+ end
10
+ add_index :admin_notes, [:resource_type, :resource_id]
11
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
12
+ end
13
+
14
+ def self.down
15
+ drop_table :admin_notes
16
+ end
17
+ end
@@ -0,0 +1,26 @@
1
+ class MoveAdminNotesToComments < ActiveRecord::Migration
2
+ def self.up
3
+ remove_index :admin_notes, [:admin_user_type, :admin_user_id]
4
+ rename_table :admin_notes, :active_admin_comments
5
+ rename_column :active_admin_comments, :admin_user_type, :author_type
6
+ rename_column :active_admin_comments, :admin_user_id, :author_id
7
+ add_column :active_admin_comments, :namespace, :string
8
+ add_index :active_admin_comments, [:namespace]
9
+ add_index :active_admin_comments, [:author_type, :author_id]
10
+
11
+ # Update all the existing comments to the default namespace
12
+ say "Updating any existing comments to the #{ActiveAdmin.application.default_namespace} namespace."
13
+ comments_table_name = ActiveRecord::Migrator.proper_table_name("active_admin_comments")
14
+ execute "UPDATE #{comments_table_name} SET namespace='#{ActiveAdmin.application.default_namespace}'"
15
+ end
16
+
17
+ def self.down
18
+ remove_index :active_admin_comments, :column => [:author_type, :author_id]
19
+ remove_index :active_admin_comments, :column => [:namespace]
20
+ remove_column :active_admin_comments, :namespace
21
+ rename_column :active_admin_comments, :author_id, :admin_user_id
22
+ rename_column :active_admin_comments, :author_type, :admin_user_type
23
+ rename_table :active_admin_comments, :admin_notes
24
+ add_index :admin_notes, [:admin_user_type, :admin_user_id]
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,241 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Ruby on Rails: Welcome aboard</title>
5
+ <style type="text/css" media="screen">
6
+ body {
7
+ margin: 0;
8
+ margin-bottom: 25px;
9
+ padding: 0;
10
+ background-color: #f0f0f0;
11
+ font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
12
+ font-size: 13px;
13
+ color: #333;
14
+ }
15
+
16
+ h1 {
17
+ font-size: 28px;
18
+ color: #000;
19
+ }
20
+
21
+ a {color: #03c}
22
+ a:hover {
23
+ background-color: #03c;
24
+ color: white;
25
+ text-decoration: none;
26
+ }
27
+
28
+
29
+ #page {
30
+ background-color: #f0f0f0;
31
+ width: 750px;
32
+ margin: 0;
33
+ margin-left: auto;
34
+ margin-right: auto;
35
+ }
36
+
37
+ #content {
38
+ float: left;
39
+ background-color: white;
40
+ border: 3px solid #aaa;
41
+ border-top: none;
42
+ padding: 25px;
43
+ width: 500px;
44
+ }
45
+
46
+ #sidebar {
47
+ float: right;
48
+ width: 175px;
49
+ }
50
+
51
+ #footer {
52
+ clear: both;
53
+ }
54
+
55
+ #header, #about, #getting-started {
56
+ padding-left: 75px;
57
+ padding-right: 30px;
58
+ }
59
+
60
+
61
+ #header {
62
+ background-image: url("assets/rails.png");
63
+ background-repeat: no-repeat;
64
+ background-position: top left;
65
+ height: 64px;
66
+ }
67
+ #header h1, #header h2 {margin: 0}
68
+ #header h2 {
69
+ color: #888;
70
+ font-weight: normal;
71
+ font-size: 16px;
72
+ }
73
+
74
+
75
+ #about h3 {
76
+ margin: 0;
77
+ margin-bottom: 10px;
78
+ font-size: 14px;
79
+ }
80
+
81
+ #about-content {
82
+ background-color: #ffd;
83
+ border: 1px solid #fc0;
84
+ margin-left: -55px;
85
+ margin-right: -10px;
86
+ }
87
+ #about-content table {
88
+ margin-top: 10px;
89
+ margin-bottom: 10px;
90
+ font-size: 11px;
91
+ border-collapse: collapse;
92
+ }
93
+ #about-content td {
94
+ padding: 10px;
95
+ padding-top: 3px;
96
+ padding-bottom: 3px;
97
+ }
98
+ #about-content td.name {color: #555}
99
+ #about-content td.value {color: #000}
100
+
101
+ #about-content ul {
102
+ padding: 0;
103
+ list-style-type: none;
104
+ }
105
+
106
+ #about-content.failure {
107
+ background-color: #fcc;
108
+ border: 1px solid #f00;
109
+ }
110
+ #about-content.failure p {
111
+ margin: 0;
112
+ padding: 10px;
113
+ }
114
+
115
+
116
+ #getting-started {
117
+ border-top: 1px solid #ccc;
118
+ margin-top: 25px;
119
+ padding-top: 15px;
120
+ }
121
+ #getting-started h1 {
122
+ margin: 0;
123
+ font-size: 20px;
124
+ }
125
+ #getting-started h2 {
126
+ margin: 0;
127
+ font-size: 14px;
128
+ font-weight: normal;
129
+ color: #333;
130
+ margin-bottom: 25px;
131
+ }
132
+ #getting-started ol {
133
+ margin-left: 0;
134
+ padding-left: 0;
135
+ }
136
+ #getting-started li {
137
+ font-size: 18px;
138
+ color: #888;
139
+ margin-bottom: 25px;
140
+ }
141
+ #getting-started li h2 {
142
+ margin: 0;
143
+ font-weight: normal;
144
+ font-size: 18px;
145
+ color: #333;
146
+ }
147
+ #getting-started li p {
148
+ color: #555;
149
+ font-size: 13px;
150
+ }
151
+
152
+
153
+ #sidebar ul {
154
+ margin-left: 0;
155
+ padding-left: 0;
156
+ }
157
+ #sidebar ul h3 {
158
+ margin-top: 25px;
159
+ font-size: 16px;
160
+ padding-bottom: 10px;
161
+ border-bottom: 1px solid #ccc;
162
+ }
163
+ #sidebar li {
164
+ list-style-type: none;
165
+ }
166
+ #sidebar ul.links li {
167
+ margin-bottom: 5px;
168
+ }
169
+
170
+ .filename {
171
+ font-style: italic;
172
+ }
173
+ </style>
174
+ <script type="text/javascript">
175
+ function about() {
176
+ info = document.getElementById('about-content');
177
+ if (window.XMLHttpRequest)
178
+ { xhr = new XMLHttpRequest(); }
179
+ else
180
+ { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
181
+ xhr.open("GET","rails/info/properties",false);
182
+ xhr.send("");
183
+ info.innerHTML = xhr.responseText;
184
+ info.style.display = 'block'
185
+ }
186
+ </script>
187
+ </head>
188
+ <body>
189
+ <div id="page">
190
+ <div id="sidebar">
191
+ <ul id="sidebar-items">
192
+ <li>
193
+ <h3>Browse the documentation</h3>
194
+ <ul class="links">
195
+ <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
196
+ <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
197
+ <li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
198
+ <li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
199
+ </ul>
200
+ </li>
201
+ </ul>
202
+ </div>
203
+
204
+ <div id="content">
205
+ <div id="header">
206
+ <h1>Welcome aboard</h1>
207
+ <h2>You&rsquo;re riding Ruby on Rails!</h2>
208
+ </div>
209
+
210
+ <div id="about">
211
+ <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
212
+ <div id="about-content" style="display: none"></div>
213
+ </div>
214
+
215
+ <div id="getting-started">
216
+ <h1>Getting started</h1>
217
+ <h2>Here&rsquo;s how to get rolling:</h2>
218
+
219
+ <ol>
220
+ <li>
221
+ <h2>Use <code>rails generate</code> to create your models and controllers</h2>
222
+ <p>To see all available options, run it without parameters.</p>
223
+ </li>
224
+
225
+ <li>
226
+ <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
227
+ <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
228
+ </li>
229
+
230
+ <li>
231
+ <h2>Create your database</h2>
232
+ <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
233
+ </li>
234
+ </ol>
235
+ </div>
236
+ </div>
237
+
238
+ <div id="footer">&nbsp;</div>
239
+ </div>
240
+ </body>
241
+ </html>