rails 2.2.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails might be problematic. Click here for more details.
- data/bin/rails +8 -18
- metadata +118 -452
- data/CHANGELOG +0 -2071
- data/MIT-LICENSE +0 -20
- data/README +0 -256
- data/Rakefile +0 -411
- data/bin/about +0 -4
- data/bin/console +0 -3
- data/bin/dbconsole +0 -3
- data/bin/destroy +0 -3
- data/bin/generate +0 -3
- data/bin/performance/benchmarker +0 -3
- data/bin/performance/profiler +0 -3
- data/bin/performance/request +0 -3
- data/bin/plugin +0 -3
- data/bin/process/inspector +0 -3
- data/bin/process/reaper +0 -3
- data/bin/process/spawner +0 -3
- data/bin/runner +0 -3
- data/bin/server +0 -3
- data/builtin/rails_info/rails/info.rb +0 -125
- data/builtin/rails_info/rails/info_controller.rb +0 -9
- data/builtin/rails_info/rails/info_helper.rb +0 -2
- data/builtin/rails_info/rails_info_controller.rb +0 -2
- data/config.ru +0 -17
- data/configs/apache.conf +0 -40
- data/configs/databases/frontbase.yml +0 -28
- data/configs/databases/ibm_db.yml +0 -62
- data/configs/databases/mysql.yml +0 -57
- data/configs/databases/oracle.yml +0 -39
- data/configs/databases/postgresql.yml +0 -51
- data/configs/databases/sqlite2.yml +0 -19
- data/configs/databases/sqlite3.yml +0 -22
- data/configs/empty.log +0 -0
- data/configs/initializers/inflections.rb +0 -10
- data/configs/initializers/mime_types.rb +0 -5
- data/configs/initializers/new_rails_defaults.rb +0 -17
- data/configs/lighttpd.conf +0 -54
- data/configs/locales/en.yml +0 -5
- data/configs/routes.rb +0 -43
- data/dispatches/dispatch.fcgi +0 -24
- data/dispatches/dispatch.rb +0 -10
- data/dispatches/gateway.cgi +0 -97
- data/doc/README_FOR_APP +0 -5
- data/doc/guides/html/2_2_release_notes.html +0 -1185
- data/doc/guides/html/actioncontroller_basics.html +0 -1270
- data/doc/guides/html/activerecord_validations_callbacks.html +0 -749
- data/doc/guides/html/association_basics.html +0 -2585
- data/doc/guides/html/authors.html +0 -240
- data/doc/guides/html/benchmarking_and_profiling.html +0 -1018
- data/doc/guides/html/caching_with_rails.html +0 -583
- data/doc/guides/html/command_line.html +0 -434
- data/doc/guides/html/configuring.html +0 -438
- data/doc/guides/html/creating_plugins.html +0 -1594
- data/doc/guides/html/debugging_rails_applications.html +0 -1175
- data/doc/guides/html/finders.html +0 -1090
- data/doc/guides/html/form_helpers.html +0 -638
- data/doc/guides/html/getting_started_with_rails.html +0 -2066
- data/doc/guides/html/index.html +0 -349
- data/doc/guides/html/layouts_and_rendering.html +0 -1406
- data/doc/guides/html/migrations.html +0 -921
- data/doc/guides/html/routing_outside_in.html +0 -2213
- data/doc/guides/html/security.html +0 -1346
- data/doc/guides/html/testing_rails_applications.html +0 -1859
- data/doc/guides/source/2_2_release_notes.txt +0 -435
- data/doc/guides/source/actioncontroller_basics/changelog.txt +0 -5
- data/doc/guides/source/actioncontroller_basics/cookies.txt +0 -34
- data/doc/guides/source/actioncontroller_basics/csrf.txt +0 -32
- data/doc/guides/source/actioncontroller_basics/filters.txt +0 -119
- data/doc/guides/source/actioncontroller_basics/http_auth.txt +0 -24
- data/doc/guides/source/actioncontroller_basics/index.txt +0 -40
- data/doc/guides/source/actioncontroller_basics/introduction.txt +0 -9
- data/doc/guides/source/actioncontroller_basics/methods.txt +0 -39
- data/doc/guides/source/actioncontroller_basics/parameter_filtering.txt +0 -14
- data/doc/guides/source/actioncontroller_basics/params.txt +0 -93
- data/doc/guides/source/actioncontroller_basics/request_response_objects.txt +0 -43
- data/doc/guides/source/actioncontroller_basics/rescue.txt +0 -67
- data/doc/guides/source/actioncontroller_basics/session.txt +0 -187
- data/doc/guides/source/actioncontroller_basics/streaming.txt +0 -91
- data/doc/guides/source/actioncontroller_basics/verification.txt +0 -40
- data/doc/guides/source/active_record_basics.txt +0 -181
- data/doc/guides/source/activerecord_validations_callbacks.txt +0 -404
- data/doc/guides/source/association_basics.txt +0 -1840
- data/doc/guides/source/authors.txt +0 -39
- data/doc/guides/source/benchmarking_and_profiling/appendix.txt +0 -95
- data/doc/guides/source/benchmarking_and_profiling/digging_deeper.txt +0 -105
- data/doc/guides/source/benchmarking_and_profiling/edge_rails_features.txt +0 -185
- data/doc/guides/source/benchmarking_and_profiling/gameplan.txt +0 -27
- data/doc/guides/source/benchmarking_and_profiling/index.txt +0 -242
- data/doc/guides/source/benchmarking_and_profiling/rubyprof.txt +0 -179
- data/doc/guides/source/benchmarking_and_profiling/statistics.txt +0 -57
- data/doc/guides/source/caching_with_rails.txt +0 -367
- data/doc/guides/source/command_line.txt +0 -147
- data/doc/guides/source/configuring.txt +0 -225
- data/doc/guides/source/creating_plugins/acts_as_yaffle.txt +0 -191
- data/doc/guides/source/creating_plugins/appendix.txt +0 -46
- data/doc/guides/source/creating_plugins/controllers.txt +0 -59
- data/doc/guides/source/creating_plugins/core_ext.txt +0 -123
- data/doc/guides/source/creating_plugins/custom_route.txt +0 -69
- data/doc/guides/source/creating_plugins/gem.txt +0 -1
- data/doc/guides/source/creating_plugins/generator_method.txt +0 -89
- data/doc/guides/source/creating_plugins/helpers.txt +0 -51
- data/doc/guides/source/creating_plugins/index.txt +0 -52
- data/doc/guides/source/creating_plugins/migration_generator.txt +0 -156
- data/doc/guides/source/creating_plugins/models.txt +0 -76
- data/doc/guides/source/creating_plugins/odds_and_ends.txt +0 -69
- data/doc/guides/source/creating_plugins/test_setup.txt +0 -230
- data/doc/guides/source/debugging_rails_applications.txt +0 -733
- data/doc/guides/source/finders.txt +0 -668
- data/doc/guides/source/form_helpers.txt +0 -345
- data/doc/guides/source/getting_started_with_rails.txt +0 -1256
- data/doc/guides/source/images/belongs_to.png +0 -0
- data/doc/guides/source/images/bullet.gif +0 -0
- data/doc/guides/source/images/csrf.png +0 -0
- data/doc/guides/source/images/habtm.png +0 -0
- data/doc/guides/source/images/has_many.png +0 -0
- data/doc/guides/source/images/has_many_through.png +0 -0
- data/doc/guides/source/images/has_one.png +0 -0
- data/doc/guides/source/images/has_one_through.png +0 -0
- data/doc/guides/source/images/header_backdrop.png +0 -0
- data/doc/guides/source/images/icons/README +0 -5
- data/doc/guides/source/images/icons/callouts/1.png +0 -0
- data/doc/guides/source/images/icons/callouts/10.png +0 -0
- data/doc/guides/source/images/icons/callouts/11.png +0 -0
- data/doc/guides/source/images/icons/callouts/12.png +0 -0
- data/doc/guides/source/images/icons/callouts/13.png +0 -0
- data/doc/guides/source/images/icons/callouts/14.png +0 -0
- data/doc/guides/source/images/icons/callouts/15.png +0 -0
- data/doc/guides/source/images/icons/callouts/2.png +0 -0
- data/doc/guides/source/images/icons/callouts/3.png +0 -0
- data/doc/guides/source/images/icons/callouts/4.png +0 -0
- data/doc/guides/source/images/icons/callouts/5.png +0 -0
- data/doc/guides/source/images/icons/callouts/6.png +0 -0
- data/doc/guides/source/images/icons/callouts/7.png +0 -0
- data/doc/guides/source/images/icons/callouts/8.png +0 -0
- data/doc/guides/source/images/icons/callouts/9.png +0 -0
- data/doc/guides/source/images/icons/caution.png +0 -0
- data/doc/guides/source/images/icons/example.png +0 -0
- data/doc/guides/source/images/icons/home.png +0 -0
- data/doc/guides/source/images/icons/important.png +0 -0
- data/doc/guides/source/images/icons/next.png +0 -0
- data/doc/guides/source/images/icons/note.png +0 -0
- data/doc/guides/source/images/icons/prev.png +0 -0
- data/doc/guides/source/images/icons/tip.png +0 -0
- data/doc/guides/source/images/icons/up.png +0 -0
- data/doc/guides/source/images/icons/warning.png +0 -0
- data/doc/guides/source/images/polymorphic.png +0 -0
- data/doc/guides/source/images/rails_logo_remix.gif +0 -0
- data/doc/guides/source/images/ruby_on_rails_by_mike_rundle2.gif +0 -0
- data/doc/guides/source/images/session_fixation.png +0 -0
- data/doc/guides/source/index.txt +0 -118
- data/doc/guides/source/layouts_and_rendering.txt +0 -982
- data/doc/guides/source/migrations/anatomy_of_a_migration.txt +0 -85
- data/doc/guides/source/migrations/changelog.txt +0 -5
- data/doc/guides/source/migrations/creating_a_migration.txt +0 -109
- data/doc/guides/source/migrations/foreign_keys.txt +0 -8
- data/doc/guides/source/migrations/index.txt +0 -22
- data/doc/guides/source/migrations/rakeing_around.txt +0 -111
- data/doc/guides/source/migrations/scheming.txt +0 -47
- data/doc/guides/source/migrations/using_models_in_migrations.txt +0 -46
- data/doc/guides/source/migrations/writing_a_migration.txt +0 -159
- data/doc/guides/source/routing_outside_in.txt +0 -986
- data/doc/guides/source/security.txt +0 -984
- data/doc/guides/source/stylesheets/base.css +0 -358
- data/doc/guides/source/stylesheets/forms.css +0 -35
- data/doc/guides/source/stylesheets/more.css +0 -82
- data/doc/guides/source/templates/guides.html.erb +0 -97
- data/doc/guides/source/templates/inline.css +0 -165
- data/doc/guides/source/testing_rails_applications.txt +0 -995
- data/environments/boot.rb +0 -109
- data/environments/development.rb +0 -17
- data/environments/environment.rb +0 -75
- data/environments/production.rb +0 -24
- data/environments/test.rb +0 -22
- data/fresh_rakefile +0 -10
- data/helpers/application.rb +0 -15
- data/helpers/application_helper.rb +0 -3
- data/helpers/performance_test.rb +0 -9
- data/helpers/test_helper.rb +0 -38
- data/html/404.html +0 -30
- data/html/422.html +0 -30
- data/html/500.html +0 -33
- data/html/favicon.ico +0 -0
- data/html/images/rails.png +0 -0
- data/html/index.html +0 -274
- data/html/javascripts/application.js +0 -2
- data/html/javascripts/controls.js +0 -963
- data/html/javascripts/dragdrop.js +0 -973
- data/html/javascripts/effects.js +0 -1128
- data/html/javascripts/prototype.js +0 -4320
- data/html/robots.txt +0 -5
- data/lib/code_statistics.rb +0 -107
- data/lib/commands.rb +0 -17
- data/lib/commands/about.rb +0 -3
- data/lib/commands/console.rb +0 -45
- data/lib/commands/dbconsole.rb +0 -67
- data/lib/commands/destroy.rb +0 -6
- data/lib/commands/generate.rb +0 -6
- data/lib/commands/ncgi/listener +0 -86
- data/lib/commands/ncgi/tracker +0 -69
- data/lib/commands/performance/benchmarker.rb +0 -24
- data/lib/commands/performance/profiler.rb +0 -50
- data/lib/commands/performance/request.rb +0 -6
- data/lib/commands/plugin.rb +0 -967
- data/lib/commands/process/inspector.rb +0 -68
- data/lib/commands/process/reaper.rb +0 -149
- data/lib/commands/process/spawner.rb +0 -219
- data/lib/commands/process/spinner.rb +0 -57
- data/lib/commands/runner.rb +0 -48
- data/lib/commands/server.rb +0 -49
- data/lib/commands/servers/base.rb +0 -31
- data/lib/commands/servers/lighttpd.rb +0 -94
- data/lib/commands/servers/mongrel.rb +0 -69
- data/lib/commands/servers/new_mongrel.rb +0 -16
- data/lib/commands/servers/thin.rb +0 -25
- data/lib/commands/servers/webrick.rb +0 -66
- data/lib/commands/update.rb +0 -4
- data/lib/console_app.rb +0 -30
- data/lib/console_sandbox.rb +0 -6
- data/lib/console_with_helpers.rb +0 -26
- data/lib/dispatcher.rb +0 -24
- data/lib/fcgi_handler.rb +0 -237
- data/lib/initializer.rb +0 -1038
- data/lib/performance_test_help.rb +0 -5
- data/lib/rails/gem_builder.rb +0 -21
- data/lib/rails/gem_dependency.rb +0 -251
- data/lib/rails/mongrel_server/commands.rb +0 -342
- data/lib/rails/mongrel_server/handler.rb +0 -55
- data/lib/rails/plugin.rb +0 -124
- data/lib/rails/plugin/loader.rb +0 -152
- data/lib/rails/plugin/locator.rb +0 -100
- data/lib/rails/rack.rb +0 -6
- data/lib/rails/rack/logger.rb +0 -28
- data/lib/rails/rack/static.rb +0 -35
- data/lib/rails/vendor_gem_source_index.rb +0 -140
- data/lib/rails/version.rb +0 -9
- data/lib/rails_generator.rb +0 -43
- data/lib/rails_generator/base.rb +0 -263
- data/lib/rails_generator/commands.rb +0 -616
- data/lib/rails_generator/generated_attribute.rb +0 -46
- data/lib/rails_generator/generators/applications/app/USAGE +0 -9
- data/lib/rails_generator/generators/applications/app/app_generator.rb +0 -184
- data/lib/rails_generator/generators/components/controller/USAGE +0 -29
- data/lib/rails_generator/generators/components/controller/controller_generator.rb +0 -37
- data/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -7
- data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +0 -8
- data/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -2
- data/lib/rails_generator/generators/components/controller/templates/view.html.erb +0 -2
- data/lib/rails_generator/generators/components/integration_test/USAGE +0 -8
- data/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +0 -16
- data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +0 -10
- data/lib/rails_generator/generators/components/mailer/USAGE +0 -16
- data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +0 -30
- data/lib/rails_generator/generators/components/mailer/templates/fixture.erb +0 -3
- data/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
- data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -15
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +0 -20
- data/lib/rails_generator/generators/components/mailer/templates/view.erb +0 -3
- data/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
- data/lib/rails_generator/generators/components/migration/USAGE +0 -29
- data/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -20
- data/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -11
- data/lib/rails_generator/generators/components/model/USAGE +0 -27
- data/lib/rails_generator/generators/components/model/model_generator.rb +0 -45
- data/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -19
- data/lib/rails_generator/generators/components/model/templates/migration.rb +0 -16
- data/lib/rails_generator/generators/components/model/templates/model.rb +0 -5
- data/lib/rails_generator/generators/components/model/templates/unit_test.rb +0 -8
- data/lib/rails_generator/generators/components/observer/USAGE +0 -13
- data/lib/rails_generator/generators/components/observer/observer_generator.rb +0 -16
- data/lib/rails_generator/generators/components/observer/templates/observer.rb +0 -2
- data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -8
- data/lib/rails_generator/generators/components/performance_test/USAGE +0 -8
- data/lib/rails_generator/generators/components/performance_test/performance_test_generator.rb +0 -16
- data/lib/rails_generator/generators/components/performance_test/templates/performance_test.rb +0 -9
- data/lib/rails_generator/generators/components/plugin/USAGE +0 -25
- data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +0 -39
- data/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +0 -20
- data/lib/rails_generator/generators/components/plugin/templates/README +0 -13
- data/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -23
- data/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -8
- data/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -8
- data/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/install.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -4
- data/lib/rails_generator/generators/components/plugin/templates/test_helper.rb +0 -3
- data/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +0 -8
- data/lib/rails_generator/generators/components/resource/USAGE +0 -23
- data/lib/rails_generator/generators/components/resource/resource_generator.rb +0 -74
- data/lib/rails_generator/generators/components/resource/templates/controller.rb +0 -2
- data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +0 -8
- data/lib/rails_generator/generators/components/resource/templates/helper.rb +0 -2
- data/lib/rails_generator/generators/components/scaffold/USAGE +0 -29
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +0 -100
- data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +0 -85
- data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +0 -45
- data/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -2
- data/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +0 -17
- data/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -54
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +0 -18
- data/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +0 -24
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +0 -17
- data/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +0 -10
- data/lib/rails_generator/generators/components/session_migration/USAGE +0 -10
- data/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -18
- data/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -16
- data/lib/rails_generator/lookup.rb +0 -249
- data/lib/rails_generator/manifest.rb +0 -53
- data/lib/rails_generator/options.rb +0 -150
- data/lib/rails_generator/scripts.rb +0 -89
- data/lib/rails_generator/scripts/destroy.rb +0 -29
- data/lib/rails_generator/scripts/generate.rb +0 -7
- data/lib/rails_generator/scripts/update.rb +0 -12
- data/lib/rails_generator/secret_key_generator.rb +0 -22
- data/lib/rails_generator/simple_logger.rb +0 -46
- data/lib/rails_generator/spec.rb +0 -44
- data/lib/railties_path.rb +0 -1
- data/lib/ruby_version_check.rb +0 -17
- data/lib/rubyprof_ext.rb +0 -35
- data/lib/source_annotation_extractor.rb +0 -102
- data/lib/tasks/annotations.rake +0 -20
- data/lib/tasks/databases.rake +0 -416
- data/lib/tasks/documentation.rake +0 -95
- data/lib/tasks/framework.rake +0 -118
- data/lib/tasks/gems.rake +0 -80
- data/lib/tasks/log.rake +0 -9
- data/lib/tasks/misc.rake +0 -56
- data/lib/tasks/rails.rb +0 -8
- data/lib/tasks/routes.rake +0 -17
- data/lib/tasks/statistics.rake +0 -18
- data/lib/tasks/testing.rake +0 -139
- data/lib/tasks/tmp.rake +0 -37
- data/lib/test_help.rb +0 -27
- data/lib/webrick_server.rb +0 -156
@@ -1,434 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
-
<title>A Guide to The Rails Command Line</title>
|
6
|
-
<!--[if lt IE 8]>
|
7
|
-
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
|
8
|
-
<![endif]-->
|
9
|
-
<link href="stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" />
|
10
|
-
<link href="stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" />
|
11
|
-
<link href="stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" />
|
12
|
-
<style type="text/css">
|
13
|
-
div#container {
|
14
|
-
max-width: 900px;
|
15
|
-
padding-bottom: 3em;
|
16
|
-
}
|
17
|
-
|
18
|
-
div#content {
|
19
|
-
margin-left: 200px;
|
20
|
-
}
|
21
|
-
|
22
|
-
div#container.notoc {
|
23
|
-
max-width: 600px;
|
24
|
-
}
|
25
|
-
|
26
|
-
.notoc div#content {
|
27
|
-
margin-left: 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
pre {
|
31
|
-
line-height: 1.4em;
|
32
|
-
}
|
33
|
-
|
34
|
-
#content p tt {
|
35
|
-
background: #eeeeee;
|
36
|
-
border: solid 1px #cccccc;
|
37
|
-
padding: 3px;
|
38
|
-
}
|
39
|
-
|
40
|
-
dt {
|
41
|
-
font-weight: bold;
|
42
|
-
}
|
43
|
-
|
44
|
-
#content dt tt {
|
45
|
-
font-size: 10pt;
|
46
|
-
}
|
47
|
-
|
48
|
-
dd {
|
49
|
-
margin-left: 3em;
|
50
|
-
}
|
51
|
-
|
52
|
-
#content dt tt, #content pre tt {
|
53
|
-
background: none;
|
54
|
-
padding: 0;
|
55
|
-
border: 0;
|
56
|
-
}
|
57
|
-
|
58
|
-
#content .olist ol {
|
59
|
-
margin-left: 2em;
|
60
|
-
}
|
61
|
-
|
62
|
-
#header {
|
63
|
-
position: relative;
|
64
|
-
max-width: 840px;
|
65
|
-
margin-left: auto;
|
66
|
-
margin-right: auto;
|
67
|
-
}
|
68
|
-
|
69
|
-
#header.notoc {
|
70
|
-
max-width: 580px;
|
71
|
-
}
|
72
|
-
|
73
|
-
#logo {
|
74
|
-
position: absolute;
|
75
|
-
left: 10px;
|
76
|
-
top: 10px;
|
77
|
-
width: 110px;
|
78
|
-
height: 140px;
|
79
|
-
}
|
80
|
-
|
81
|
-
div#header h1#site_title {
|
82
|
-
background: url('images/ruby_on_rails_by_mike_rundle2.gif') top left no-repeat;
|
83
|
-
position: absolute;
|
84
|
-
width: 392px;
|
85
|
-
height: 55px;
|
86
|
-
left: 145px;
|
87
|
-
top: 20px;
|
88
|
-
margin: 0;
|
89
|
-
padding: 0;
|
90
|
-
}
|
91
|
-
|
92
|
-
#site_title span {
|
93
|
-
display: none;
|
94
|
-
}
|
95
|
-
|
96
|
-
#site_title_tagline {
|
97
|
-
display: none;
|
98
|
-
}
|
99
|
-
|
100
|
-
ul#navMain {
|
101
|
-
position: absolute;
|
102
|
-
margin: 0;
|
103
|
-
padding: 0;
|
104
|
-
top: 97px;
|
105
|
-
left: 145px;
|
106
|
-
}
|
107
|
-
|
108
|
-
.left-floaty, .right-floaty {
|
109
|
-
padding: 15px;
|
110
|
-
}
|
111
|
-
|
112
|
-
.admonitionblock,
|
113
|
-
.tableblock {
|
114
|
-
margin-left: 1em;
|
115
|
-
margin-right: 1em;
|
116
|
-
margin-top: 0.25em;
|
117
|
-
margin-bottom: 1em;
|
118
|
-
}
|
119
|
-
|
120
|
-
.admonitionblock .icon {
|
121
|
-
padding-right: 8px;
|
122
|
-
}
|
123
|
-
|
124
|
-
.admonitionblock .content {
|
125
|
-
border: solid 1px #ffda78;
|
126
|
-
background: #fffebd;
|
127
|
-
padding: 10px;
|
128
|
-
padding-top: 8px;
|
129
|
-
padding-bottom: 8px;
|
130
|
-
}
|
131
|
-
|
132
|
-
.admonitionblock .title {
|
133
|
-
font-size: 140%;
|
134
|
-
margin-bottom: 0.5em;
|
135
|
-
}
|
136
|
-
|
137
|
-
.tableblock table {
|
138
|
-
border: solid 1px #aaaaff;
|
139
|
-
background: #f0f0ff;
|
140
|
-
}
|
141
|
-
|
142
|
-
.tableblock th {
|
143
|
-
background: #e0e0e0;
|
144
|
-
}
|
145
|
-
|
146
|
-
.tableblock th,
|
147
|
-
.tableblock td {
|
148
|
-
padding: 3px;
|
149
|
-
padding-left: 5px;
|
150
|
-
padding-right: 5px;
|
151
|
-
}
|
152
|
-
|
153
|
-
.sidebarblock {
|
154
|
-
margin-top: 0.25em;
|
155
|
-
margin: 1em;
|
156
|
-
border: solid 1px #ccccbb;
|
157
|
-
padding: 8px;
|
158
|
-
background: #ffffe0;
|
159
|
-
}
|
160
|
-
|
161
|
-
.sidebarblock .sidebar-title {
|
162
|
-
font-size: 140%;
|
163
|
-
font-weight: 600;
|
164
|
-
margin-bottom: 0.3em;
|
165
|
-
}
|
166
|
-
|
167
|
-
.sidebarblock .sidebar-content > .para:last-child > p {
|
168
|
-
margin-bottom: 0;
|
169
|
-
}
|
170
|
-
|
171
|
-
.sidebarblock .sidebar-title a {
|
172
|
-
text-decoration: none;
|
173
|
-
}
|
174
|
-
|
175
|
-
.sidebarblock .sidebar-title a:hover {
|
176
|
-
text-decoration: underline;
|
177
|
-
}
|
178
|
-
|
179
|
-
</style>
|
180
|
-
</head>
|
181
|
-
<body>
|
182
|
-
<div id="header" >
|
183
|
-
<div id="logo">
|
184
|
-
<a href="index.html" title="Ruby on Rails"><img src="images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
<h1 id="site_title"><span>Ruby on Rails</span></h1>
|
188
|
-
<h2 id="site_title_tagline">Sustainable productivity for web-application development</h2>
|
189
|
-
|
190
|
-
<ul id="navMain">
|
191
|
-
<li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li>
|
192
|
-
<li><a class="manuals" href="index.html" title="Manuals Index">Guides Index</a></li>
|
193
|
-
</ul>
|
194
|
-
</div>
|
195
|
-
|
196
|
-
<div id="container">
|
197
|
-
|
198
|
-
<div id="sidebar">
|
199
|
-
<h2>Chapters</h2>
|
200
|
-
<ol>
|
201
|
-
<li>
|
202
|
-
<a href="#_command_line_basics">Command Line Basics</a>
|
203
|
-
<ul>
|
204
|
-
|
205
|
-
<li><a href="#_rails">rails</a></li>
|
206
|
-
|
207
|
-
<li><a href="#_server">server</a></li>
|
208
|
-
|
209
|
-
<li><a href="#_generate">generate</a></li>
|
210
|
-
|
211
|
-
</ul>
|
212
|
-
</li>
|
213
|
-
</ol>
|
214
|
-
</div>
|
215
|
-
|
216
|
-
<div id="content">
|
217
|
-
<h1>A Guide to The Rails Command Line</h1>
|
218
|
-
<div id="preamble">
|
219
|
-
<div class="sectionbody">
|
220
|
-
<div class="para"><p>Rails comes with every command line tool you'll need to</p></div>
|
221
|
-
<div class="ilist"><ul>
|
222
|
-
<li>
|
223
|
-
<p>
|
224
|
-
Create a Rails application
|
225
|
-
</p>
|
226
|
-
</li>
|
227
|
-
<li>
|
228
|
-
<p>
|
229
|
-
Generate models, controllers, database migrations, and unit tests
|
230
|
-
</p>
|
231
|
-
</li>
|
232
|
-
<li>
|
233
|
-
<p>
|
234
|
-
Start a development server
|
235
|
-
</p>
|
236
|
-
</li>
|
237
|
-
<li>
|
238
|
-
<p>
|
239
|
-
Mess with objects through an interactive shell
|
240
|
-
</p>
|
241
|
-
</li>
|
242
|
-
<li>
|
243
|
-
<p>
|
244
|
-
Profile and benchmark your new creation
|
245
|
-
</p>
|
246
|
-
</li>
|
247
|
-
</ul></div>
|
248
|
-
<div class="para"><p>… and much, much more! (Buy now!)</p></div>
|
249
|
-
<div class="para"><p>This tutorial assumes you have basic Rails knowledge from reading the Getting Started with Rails Guide.</p></div>
|
250
|
-
</div>
|
251
|
-
</div>
|
252
|
-
<h2 id="_command_line_basics">1. Command Line Basics</h2>
|
253
|
-
<div class="sectionbody">
|
254
|
-
<div class="para"><p>There are a few commands that are absolutely critical to your everyday usage of Rails. In the order of how much you'll probably use them are:</p></div>
|
255
|
-
<div class="ilist"><ul>
|
256
|
-
<li>
|
257
|
-
<p>
|
258
|
-
console
|
259
|
-
</p>
|
260
|
-
</li>
|
261
|
-
<li>
|
262
|
-
<p>
|
263
|
-
server
|
264
|
-
</p>
|
265
|
-
</li>
|
266
|
-
<li>
|
267
|
-
<p>
|
268
|
-
rake
|
269
|
-
</p>
|
270
|
-
</li>
|
271
|
-
<li>
|
272
|
-
<p>
|
273
|
-
generate
|
274
|
-
</p>
|
275
|
-
</li>
|
276
|
-
<li>
|
277
|
-
<p>
|
278
|
-
rails
|
279
|
-
</p>
|
280
|
-
</li>
|
281
|
-
</ul></div>
|
282
|
-
<div class="para"><p>Let's create a simple Rails application to step through each of these commands in context.</p></div>
|
283
|
-
<h3 id="_rails">1.1. rails</h3>
|
284
|
-
<div class="para"><p>The first thing we'll want to do is create a new Rails application by running the <tt>rails</tt> command after installing Rails.</p></div>
|
285
|
-
<div class="admonitionblock">
|
286
|
-
<table><tr>
|
287
|
-
<td class="icon">
|
288
|
-
<img src="./images/icons/note.png" alt="Note" />
|
289
|
-
</td>
|
290
|
-
<td class="content">You know you need the rails gem installed by typing <tt>gem install rails</tt> first, right? Okay, okay, just making sure.</td>
|
291
|
-
</tr></table>
|
292
|
-
</div>
|
293
|
-
<div class="listingblock">
|
294
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.9
|
295
|
-
by Lorenzo Bettini
|
296
|
-
http://www.lorenzobettini.it
|
297
|
-
http://www.gnu.org/software/src-highlite -->
|
298
|
-
<pre><tt>$ rails commandsapp
|
299
|
-
|
300
|
-
create
|
301
|
-
create app/controllers
|
302
|
-
create app/helpers
|
303
|
-
create app/models
|
304
|
-
<span style="color: #990000">...</span>
|
305
|
-
<span style="color: #990000">...</span>
|
306
|
-
create log/production<span style="color: #990000">.</span>log
|
307
|
-
create log/development<span style="color: #990000">.</span>log
|
308
|
-
create log/test<span style="color: #990000">.</span>log
|
309
|
-
</tt></pre></div></div>
|
310
|
-
<div class="para"><p>Rails will set you up with what seems like a huge amount of stuff for such a tiny command! You've got the entire Rails directory structure now with all the code you need to run our simple application right out of the box.</p></div>
|
311
|
-
<div class="admonitionblock">
|
312
|
-
<table><tr>
|
313
|
-
<td class="icon">
|
314
|
-
<img src="./images/icons/note.png" alt="Note" />
|
315
|
-
</td>
|
316
|
-
<td class="content">This output will seem very familiar when we get to the <tt>generate</tt> command. Creepy foreshadowing!</td>
|
317
|
-
</tr></table>
|
318
|
-
</div>
|
319
|
-
<h3 id="_server">1.2. server</h3>
|
320
|
-
<div class="para"><p>Let's try it! The <tt>server</tt> command launches a small web server written in Ruby named WEBrick which was also installed when you installed Rails. You'll use this any time you want to view your work through a web browser.</p></div>
|
321
|
-
<div class="admonitionblock">
|
322
|
-
<table><tr>
|
323
|
-
<td class="icon">
|
324
|
-
<img src="./images/icons/note.png" alt="Note" />
|
325
|
-
</td>
|
326
|
-
<td class="content">WEBrick isn't your only option for serving Rails. We'll get to that in a later section. [XXX: which section]</td>
|
327
|
-
</tr></table>
|
328
|
-
</div>
|
329
|
-
<div class="para"><p>Here we'll flex our <tt>server</tt> command, which without any prodding of any kind will run our new shiny Rails app:</p></div>
|
330
|
-
<div class="listingblock">
|
331
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.9
|
332
|
-
by Lorenzo Bettini
|
333
|
-
http://www.lorenzobettini.it
|
334
|
-
http://www.gnu.org/software/src-highlite -->
|
335
|
-
<pre><tt>$ cd commandsapp
|
336
|
-
$ <span style="color: #990000">.</span>/script/server
|
337
|
-
<span style="color: #990000">=></span> Booting WEBrick<span style="color: #990000">...</span>
|
338
|
-
<span style="color: #990000">=></span> Rails <span style="color: #993399">2.2</span><span style="color: #990000">.</span><span style="color: #993399">0</span> application started on http<span style="color: #990000">://</span><span style="color: #993399">0.0</span><span style="color: #990000">.</span><span style="color: #993399">0.0</span><span style="color: #990000">:</span><span style="color: #993399">3000</span>
|
339
|
-
<span style="color: #990000">=></span> Ctrl-C to shutdown server<span style="color: #990000">;</span> call with --help <span style="font-weight: bold"><span style="color: #0000FF">for</span></span> options
|
340
|
-
<span style="color: #990000">[</span><span style="color: #993399">2008</span>-<span style="color: #993399">11</span>-<span style="color: #993399">04</span> <span style="color: #993399">10</span><span style="color: #990000">:</span><span style="color: #993399">11</span><span style="color: #990000">:</span><span style="color: #993399">38</span><span style="color: #990000">]</span> INFO WEBrick <span style="color: #993399">1.3</span><span style="color: #990000">.</span><span style="color: #993399">1</span>
|
341
|
-
<span style="color: #990000">[</span><span style="color: #993399">2008</span>-<span style="color: #993399">11</span>-<span style="color: #993399">04</span> <span style="color: #993399">10</span><span style="color: #990000">:</span><span style="color: #993399">11</span><span style="color: #990000">:</span><span style="color: #993399">38</span><span style="color: #990000">]</span> INFO ruby <span style="color: #993399">1.8</span><span style="color: #990000">.</span><span style="color: #993399">5</span> <span style="color: #990000">(</span><span style="color: #993399">2006</span>-<span style="color: #993399">12</span>-<span style="color: #993399">04</span><span style="color: #990000">)</span> <span style="color: #990000">[</span>i486-linux<span style="color: #990000">]</span>
|
342
|
-
<span style="color: #990000">[</span><span style="color: #993399">2008</span>-<span style="color: #993399">11</span>-<span style="color: #993399">04</span> <span style="color: #993399">10</span><span style="color: #990000">:</span><span style="color: #993399">11</span><span style="color: #990000">:</span><span style="color: #993399">38</span><span style="color: #990000">]</span> INFO WEBrick<span style="color: #990000">::</span>HTTPServer<span style="font-style: italic"><span style="color: #9A1900">#start: pid=18994 port=3000</span></span>
|
343
|
-
</tt></pre></div></div>
|
344
|
-
<div class="para"><p>WHOA. With just three commands we whipped up a Rails server listening on port 3000. Go! Go right now to your browser and go to <a href="http://localhost:3000">http://localhost:3000</a>. I'll wait.</p></div>
|
345
|
-
<div class="para"><p>See? Cool! It doesn't do much yet, but we'll change that.</p></div>
|
346
|
-
<h3 id="_generate">1.3. generate</h3>
|
347
|
-
<div class="para"><p>The <tt>generate</tt> command uses templates to create a whole lot of things. You can always find out what's available by running <tt>generate</tt> by itself. Let's do that:</p></div>
|
348
|
-
<div class="listingblock">
|
349
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.9
|
350
|
-
by Lorenzo Bettini
|
351
|
-
http://www.lorenzobettini.it
|
352
|
-
http://www.gnu.org/software/src-highlite -->
|
353
|
-
<pre><tt>$ <span style="color: #990000">.</span>/script/generate
|
354
|
-
Usage<span style="color: #990000">:</span> <span style="color: #990000">.</span>/script/generate generator <span style="color: #990000">[</span>options<span style="color: #990000">]</span> <span style="color: #990000">[</span>args<span style="color: #990000">]</span>
|
355
|
-
|
356
|
-
<span style="color: #990000">...</span>
|
357
|
-
<span style="color: #990000">...</span>
|
358
|
-
|
359
|
-
Installed Generators
|
360
|
-
Builtin<span style="color: #990000">:</span> controller<span style="color: #990000">,</span> integration_test<span style="color: #990000">,</span> mailer<span style="color: #990000">,</span> migration<span style="color: #990000">,</span> model<span style="color: #990000">,</span> observer<span style="color: #990000">,</span> performance_test<span style="color: #990000">,</span> plugin<span style="color: #990000">,</span> resource<span style="color: #990000">,</span> scaffold<span style="color: #990000">,</span> session_migration
|
361
|
-
|
362
|
-
<span style="color: #990000">...</span>
|
363
|
-
<span style="color: #990000">...</span>
|
364
|
-
</tt></pre></div></div>
|
365
|
-
<div class="admonitionblock">
|
366
|
-
<table><tr>
|
367
|
-
<td class="icon">
|
368
|
-
<img src="./images/icons/note.png" alt="Note" />
|
369
|
-
</td>
|
370
|
-
<td class="content">You can install more generators through generator gems, portions of plugins you'll undoubtedly install, and you can even create your own!</td>
|
371
|
-
</tr></table>
|
372
|
-
</div>
|
373
|
-
<div class="para"><p>Using generators will save you a large amount of time by writing <strong>boilerplate code</strong> for you — necessary for the darn thing to work, but not necessary for you to spend time writing. That's what we have computers for, right?</p></div>
|
374
|
-
<div class="para"><p>Let's make our own controller with the controller generator. But what command should we use? Let's ask the generator:</p></div>
|
375
|
-
<div class="admonitionblock">
|
376
|
-
<table><tr>
|
377
|
-
<td class="icon">
|
378
|
-
<img src="./images/icons/note.png" alt="Note" />
|
379
|
-
</td>
|
380
|
-
<td class="content">All Rails console utilities have help text. For commands that require a lot of input to run correctly, you can just try the command without any parameters (like <tt>rails</tt> or <tt>./script/generate</tt>). For others, you can try adding <tt>—help</tt> or <tt>-h</tt> to the end, as in <tt>./script/server —help</tt>.</td>
|
381
|
-
</tr></table>
|
382
|
-
</div>
|
383
|
-
<div class="listingblock">
|
384
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.9
|
385
|
-
by Lorenzo Bettini
|
386
|
-
http://www.lorenzobettini.it
|
387
|
-
http://www.gnu.org/software/src-highlite -->
|
388
|
-
<pre><tt>$ <span style="color: #990000">.</span>/script/generate controller
|
389
|
-
Usage<span style="color: #990000">:</span> <span style="color: #990000">.</span>/script/generate controller ControllerName <span style="color: #990000">[</span>options<span style="color: #990000">]</span>
|
390
|
-
|
391
|
-
<span style="color: #990000">...</span>
|
392
|
-
<span style="color: #990000">...</span>
|
393
|
-
|
394
|
-
Example<span style="color: #990000">:</span>
|
395
|
-
`<span style="color: #990000">.</span>/script/generate controller CreditCard open debit credit close`
|
396
|
-
|
397
|
-
Credit card controller with URLs like /credit_card/debit<span style="color: #990000">.</span>
|
398
|
-
Controller<span style="color: #990000">:</span> app/controllers/credit_card_controller<span style="color: #990000">.</span>rb
|
399
|
-
Views<span style="color: #990000">:</span> app/views/credit_card/debit<span style="color: #990000">.</span>html<span style="color: #990000">.</span>erb <span style="color: #990000">[...]</span>
|
400
|
-
Helper<span style="color: #990000">:</span> app/helpers/credit_card_helper<span style="color: #990000">.</span>rb
|
401
|
-
Test<span style="color: #990000">:</span> test/functional/credit_card_controller_test<span style="color: #990000">.</span>rb
|
402
|
-
|
403
|
-
Modules Example<span style="color: #990000">:</span>
|
404
|
-
`<span style="color: #990000">.</span>/script/generate controller <span style="color: #FF0000">'admin/credit_card'</span> <span style="font-weight: bold"><span style="color: #0000FF">suspend</span></span> late_fee`
|
405
|
-
|
406
|
-
Credit card admin controller with URLs /admin/credit_card/suspend<span style="color: #990000">.</span>
|
407
|
-
Controller<span style="color: #990000">:</span> app/controllers/admin/credit_card_controller<span style="color: #990000">.</span>rb
|
408
|
-
Views<span style="color: #990000">:</span> app/views/admin/credit_card/debit<span style="color: #990000">.</span>html<span style="color: #990000">.</span>erb <span style="color: #990000">[...]</span>
|
409
|
-
Helper<span style="color: #990000">:</span> app/helpers/admin/credit_card_helper<span style="color: #990000">.</span>rb
|
410
|
-
Test<span style="color: #990000">:</span> test/functional/admin/credit_card_controller_test<span style="color: #990000">.</span>rb
|
411
|
-
</tt></pre></div></div>
|
412
|
-
<div class="para"><p>Ah, the controller generator is expecting parameters in the form of <tt>generate controller ControllerName action1 action2</tt>. Let's make a <tt>Greetings</tt> controller with an action of <strong>hello</strong>, which will say something nice to us.</p></div>
|
413
|
-
<div class="listingblock">
|
414
|
-
<div class="content"><!-- Generator: GNU source-highlight 2.9
|
415
|
-
by Lorenzo Bettini
|
416
|
-
http://www.lorenzobettini.it
|
417
|
-
http://www.gnu.org/software/src-highlite -->
|
418
|
-
<pre><tt>$ <span style="color: #990000">.</span>/script/generate controller Greeting hello
|
419
|
-
exists app/controllers<span style="color: #990000">/</span>
|
420
|
-
exists app/helpers<span style="color: #990000">/</span>
|
421
|
-
create app/views/greeting
|
422
|
-
exists test/functional<span style="color: #990000">/</span>
|
423
|
-
create app/controllers/greetings_controller<span style="color: #990000">.</span>rb
|
424
|
-
create test/functional/greetings_controller_test<span style="color: #990000">.</span>rb
|
425
|
-
create app/helpers/greetings_helper<span style="color: #990000">.</span>rb
|
426
|
-
create app/views/greetings/hello<span style="color: #990000">.</span>html<span style="color: #990000">.</span>erb
|
427
|
-
</tt></pre></div></div>
|
428
|
-
<div class="para"><p>Look there! Now what all did this generate? It looks like it made sure a bunch of directories were in our application, and created a controller file, a functional test file, a helper for the view, and a view file. All from one command!</p></div>
|
429
|
-
</div>
|
430
|
-
|
431
|
-
</div>
|
432
|
-
</div>
|
433
|
-
</body>
|
434
|
-
</html>
|
@@ -1,438 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
-
<title>Configuring Rails Applications</title>
|
6
|
-
<!--[if lt IE 8]>
|
7
|
-
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
|
8
|
-
<![endif]-->
|
9
|
-
<link href="stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" />
|
10
|
-
<link href="stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" />
|
11
|
-
<link href="stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" />
|
12
|
-
<style type="text/css">
|
13
|
-
div#container {
|
14
|
-
max-width: 900px;
|
15
|
-
padding-bottom: 3em;
|
16
|
-
}
|
17
|
-
|
18
|
-
div#content {
|
19
|
-
margin-left: 200px;
|
20
|
-
}
|
21
|
-
|
22
|
-
div#container.notoc {
|
23
|
-
max-width: 600px;
|
24
|
-
}
|
25
|
-
|
26
|
-
.notoc div#content {
|
27
|
-
margin-left: 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
pre {
|
31
|
-
line-height: 1.4em;
|
32
|
-
}
|
33
|
-
|
34
|
-
#content p tt {
|
35
|
-
background: #eeeeee;
|
36
|
-
border: solid 1px #cccccc;
|
37
|
-
padding: 3px;
|
38
|
-
}
|
39
|
-
|
40
|
-
dt {
|
41
|
-
font-weight: bold;
|
42
|
-
}
|
43
|
-
|
44
|
-
#content dt tt {
|
45
|
-
font-size: 10pt;
|
46
|
-
}
|
47
|
-
|
48
|
-
dd {
|
49
|
-
margin-left: 3em;
|
50
|
-
}
|
51
|
-
|
52
|
-
#content dt tt, #content pre tt {
|
53
|
-
background: none;
|
54
|
-
padding: 0;
|
55
|
-
border: 0;
|
56
|
-
}
|
57
|
-
|
58
|
-
#content .olist ol {
|
59
|
-
margin-left: 2em;
|
60
|
-
}
|
61
|
-
|
62
|
-
#header {
|
63
|
-
position: relative;
|
64
|
-
max-width: 840px;
|
65
|
-
margin-left: auto;
|
66
|
-
margin-right: auto;
|
67
|
-
}
|
68
|
-
|
69
|
-
#header.notoc {
|
70
|
-
max-width: 580px;
|
71
|
-
}
|
72
|
-
|
73
|
-
#logo {
|
74
|
-
position: absolute;
|
75
|
-
left: 10px;
|
76
|
-
top: 10px;
|
77
|
-
width: 110px;
|
78
|
-
height: 140px;
|
79
|
-
}
|
80
|
-
|
81
|
-
div#header h1#site_title {
|
82
|
-
background: url('images/ruby_on_rails_by_mike_rundle2.gif') top left no-repeat;
|
83
|
-
position: absolute;
|
84
|
-
width: 392px;
|
85
|
-
height: 55px;
|
86
|
-
left: 145px;
|
87
|
-
top: 20px;
|
88
|
-
margin: 0;
|
89
|
-
padding: 0;
|
90
|
-
}
|
91
|
-
|
92
|
-
#site_title span {
|
93
|
-
display: none;
|
94
|
-
}
|
95
|
-
|
96
|
-
#site_title_tagline {
|
97
|
-
display: none;
|
98
|
-
}
|
99
|
-
|
100
|
-
ul#navMain {
|
101
|
-
position: absolute;
|
102
|
-
margin: 0;
|
103
|
-
padding: 0;
|
104
|
-
top: 97px;
|
105
|
-
left: 145px;
|
106
|
-
}
|
107
|
-
|
108
|
-
.left-floaty, .right-floaty {
|
109
|
-
padding: 15px;
|
110
|
-
}
|
111
|
-
|
112
|
-
.admonitionblock,
|
113
|
-
.tableblock {
|
114
|
-
margin-left: 1em;
|
115
|
-
margin-right: 1em;
|
116
|
-
margin-top: 0.25em;
|
117
|
-
margin-bottom: 1em;
|
118
|
-
}
|
119
|
-
|
120
|
-
.admonitionblock .icon {
|
121
|
-
padding-right: 8px;
|
122
|
-
}
|
123
|
-
|
124
|
-
.admonitionblock .content {
|
125
|
-
border: solid 1px #ffda78;
|
126
|
-
background: #fffebd;
|
127
|
-
padding: 10px;
|
128
|
-
padding-top: 8px;
|
129
|
-
padding-bottom: 8px;
|
130
|
-
}
|
131
|
-
|
132
|
-
.admonitionblock .title {
|
133
|
-
font-size: 140%;
|
134
|
-
margin-bottom: 0.5em;
|
135
|
-
}
|
136
|
-
|
137
|
-
.tableblock table {
|
138
|
-
border: solid 1px #aaaaff;
|
139
|
-
background: #f0f0ff;
|
140
|
-
}
|
141
|
-
|
142
|
-
.tableblock th {
|
143
|
-
background: #e0e0e0;
|
144
|
-
}
|
145
|
-
|
146
|
-
.tableblock th,
|
147
|
-
.tableblock td {
|
148
|
-
padding: 3px;
|
149
|
-
padding-left: 5px;
|
150
|
-
padding-right: 5px;
|
151
|
-
}
|
152
|
-
|
153
|
-
.sidebarblock {
|
154
|
-
margin-top: 0.25em;
|
155
|
-
margin: 1em;
|
156
|
-
border: solid 1px #ccccbb;
|
157
|
-
padding: 8px;
|
158
|
-
background: #ffffe0;
|
159
|
-
}
|
160
|
-
|
161
|
-
.sidebarblock .sidebar-title {
|
162
|
-
font-size: 140%;
|
163
|
-
font-weight: 600;
|
164
|
-
margin-bottom: 0.3em;
|
165
|
-
}
|
166
|
-
|
167
|
-
.sidebarblock .sidebar-content > .para:last-child > p {
|
168
|
-
margin-bottom: 0;
|
169
|
-
}
|
170
|
-
|
171
|
-
.sidebarblock .sidebar-title a {
|
172
|
-
text-decoration: none;
|
173
|
-
}
|
174
|
-
|
175
|
-
.sidebarblock .sidebar-title a:hover {
|
176
|
-
text-decoration: underline;
|
177
|
-
}
|
178
|
-
|
179
|
-
</style>
|
180
|
-
</head>
|
181
|
-
<body>
|
182
|
-
<div id="header" >
|
183
|
-
<div id="logo">
|
184
|
-
<a href="index.html" title="Ruby on Rails"><img src="images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
<h1 id="site_title"><span>Ruby on Rails</span></h1>
|
188
|
-
<h2 id="site_title_tagline">Sustainable productivity for web-application development</h2>
|
189
|
-
|
190
|
-
<ul id="navMain">
|
191
|
-
<li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li>
|
192
|
-
<li><a class="manuals" href="index.html" title="Manuals Index">Guides Index</a></li>
|
193
|
-
</ul>
|
194
|
-
</div>
|
195
|
-
|
196
|
-
<div id="container">
|
197
|
-
|
198
|
-
<div id="sidebar">
|
199
|
-
<h2>Chapters</h2>
|
200
|
-
<ol>
|
201
|
-
<li>
|
202
|
-
<a href="#_locations_for_initialization_code">Locations for Initialization Code</a>
|
203
|
-
</li>
|
204
|
-
<li>
|
205
|
-
<a href="#_using_a_preinitializer">Using a Preinitializer</a>
|
206
|
-
</li>
|
207
|
-
<li>
|
208
|
-
<a href="#_configuring_rails_components">Configuring Rails Components</a>
|
209
|
-
<ul>
|
210
|
-
|
211
|
-
<li><a href="#_configuring_active_record">Configuring Active Record</a></li>
|
212
|
-
|
213
|
-
<li><a href="#_configuring_action_controller">Configuring Action Controller</a></li>
|
214
|
-
|
215
|
-
<li><a href="#_configuring_action_view">Configuring Action View</a></li>
|
216
|
-
|
217
|
-
<li><a href="#_configuring_action_mailer">Configuring Action Mailer</a></li>
|
218
|
-
|
219
|
-
<li><a href="#_configuring_active_resource">Configuring Active Resource</a></li>
|
220
|
-
|
221
|
-
<li><a href="#_configuring_active_support">Configuring Active Support</a></li>
|
222
|
-
|
223
|
-
</ul>
|
224
|
-
</li>
|
225
|
-
<li>
|
226
|
-
<a href="#_using_initializers">Using Initializers</a>
|
227
|
-
</li>
|
228
|
-
<li>
|
229
|
-
<a href="#_using_an_after_initializer">Using an After-Initializer</a>
|
230
|
-
</li>
|
231
|
-
<li>
|
232
|
-
<a href="#_changelog">Changelog</a>
|
233
|
-
</li>
|
234
|
-
</ol>
|
235
|
-
</div>
|
236
|
-
|
237
|
-
<div id="content">
|
238
|
-
<h1>Configuring Rails Applications</h1>
|
239
|
-
<div id="preamble">
|
240
|
-
<div class="sectionbody">
|
241
|
-
<div class="para"><p>This guide covers the configuration and initialization features available to Rails applications. By referring to this guide, you will be able to:</p></div>
|
242
|
-
<div class="ilist"><ul>
|
243
|
-
<li>
|
244
|
-
<p>
|
245
|
-
Adjust the behavior of your Rails applications
|
246
|
-
</p>
|
247
|
-
</li>
|
248
|
-
<li>
|
249
|
-
<p>
|
250
|
-
Add additional code to be run at application start time
|
251
|
-
</p>
|
252
|
-
</li>
|
253
|
-
</ul></div>
|
254
|
-
</div>
|
255
|
-
</div>
|
256
|
-
<h2 id="_locations_for_initialization_code">1. Locations for Initialization Code</h2>
|
257
|
-
<div class="sectionbody">
|
258
|
-
<div class="para"><p>preinitializers
|
259
|
-
environment.rb first
|
260
|
-
env-specific files
|
261
|
-
initializers (load_application_initializers)
|
262
|
-
after-initializer</p></div>
|
263
|
-
</div>
|
264
|
-
<h2 id="_using_a_preinitializer">2. Using a Preinitializer</h2>
|
265
|
-
<div class="sectionbody">
|
266
|
-
</div>
|
267
|
-
<h2 id="_configuring_rails_components">3. Configuring Rails Components</h2>
|
268
|
-
<div class="sectionbody">
|
269
|
-
<h3 id="_configuring_active_record">3.1. Configuring Active Record</h3>
|
270
|
-
<h3 id="_configuring_action_controller">3.2. Configuring Action Controller</h3>
|
271
|
-
<h3 id="_configuring_action_view">3.3. Configuring Action View</h3>
|
272
|
-
<h3 id="_configuring_action_mailer">3.4. Configuring Action Mailer</h3>
|
273
|
-
<h3 id="_configuring_active_resource">3.5. Configuring Active Resource</h3>
|
274
|
-
<h3 id="_configuring_active_support">3.6. Configuring Active Support</h3>
|
275
|
-
</div>
|
276
|
-
<h2 id="_using_initializers">4. Using Initializers</h2>
|
277
|
-
<div class="sectionbody">
|
278
|
-
<div class="literalblock">
|
279
|
-
<div class="content">
|
280
|
-
<pre><tt>organization, controlling load order</tt></pre>
|
281
|
-
</div></div>
|
282
|
-
</div>
|
283
|
-
<h2 id="_using_an_after_initializer">5. Using an After-Initializer</h2>
|
284
|
-
<div class="sectionbody">
|
285
|
-
</div>
|
286
|
-
<h2 id="_changelog">6. Changelog</h2>
|
287
|
-
<div class="sectionbody">
|
288
|
-
<div class="para"><p><a href="http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/28">Lighthouse ticket</a></p></div>
|
289
|
-
<div class="ilist"><ul>
|
290
|
-
<li>
|
291
|
-
<p>
|
292
|
-
November 5, 2008: Rough outline by <a href="../authors.html#mgunderloy">Mike Gunderloy</a>
|
293
|
-
</p>
|
294
|
-
</li>
|
295
|
-
</ul></div>
|
296
|
-
<div class="para"><p>actionmailer/lib/action_mailer/base.rb
|
297
|
-
257: cattr_accessor :logger
|
298
|
-
267: cattr_accessor :smtp_settings
|
299
|
-
273: cattr_accessor :sendmail_settings
|
300
|
-
276: cattr_accessor :raise_delivery_errors
|
301
|
-
282: cattr_accessor :perform_deliveries
|
302
|
-
285: cattr_accessor :deliveries
|
303
|
-
288: cattr_accessor :default_charset
|
304
|
-
291: cattr_accessor :default_content_type
|
305
|
-
294: cattr_accessor :default_mime_version
|
306
|
-
297: cattr_accessor :default_implicit_parts_order
|
307
|
-
299: cattr_reader :protected_instance_variables</p></div>
|
308
|
-
<div class="para"><p>actionmailer/Rakefile
|
309
|
-
36: rdoc.options << <em>—line-numbers</em> << <em>—inline-source</em> << <em>-A cattr_accessor=object</em></p></div>
|
310
|
-
<div class="para"><p>actionpack/lib/action_controller/base.rb
|
311
|
-
263: cattr_reader :protected_instance_variables
|
312
|
-
273: cattr_accessor :asset_host
|
313
|
-
279: cattr_accessor :consider_all_requests_local
|
314
|
-
285: cattr_accessor :allow_concurrency
|
315
|
-
317: cattr_accessor :param_parsers
|
316
|
-
321: cattr_accessor :default_charset
|
317
|
-
325: cattr_accessor :logger
|
318
|
-
329: cattr_accessor :resource_action_separator
|
319
|
-
333: cattr_accessor :resources_path_names
|
320
|
-
337: cattr_accessor :request_forgery_protection_token
|
321
|
-
341: cattr_accessor :optimise_named_routes
|
322
|
-
351: cattr_accessor :use_accept_header
|
323
|
-
361: cattr_accessor :relative_url_root</p></div>
|
324
|
-
<div class="para"><p>actionpack/lib/action_controller/caching/pages.rb
|
325
|
-
55: cattr_accessor :page_cache_directory
|
326
|
-
58: cattr_accessor :page_cache_extension</p></div>
|
327
|
-
<div class="para"><p>actionpack/lib/action_controller/caching.rb
|
328
|
-
37: cattr_reader :cache_store
|
329
|
-
48: cattr_accessor :perform_caching</p></div>
|
330
|
-
<div class="para"><p>actionpack/lib/action_controller/dispatcher.rb
|
331
|
-
98: cattr_accessor :error_file_path</p></div>
|
332
|
-
<div class="para"><p>actionpack/lib/action_controller/mime_type.rb
|
333
|
-
24: cattr_reader :html_types, :unverifiable_types</p></div>
|
334
|
-
<div class="para"><p>actionpack/lib/action_controller/rescue.rb
|
335
|
-
36: base.cattr_accessor :rescue_responses
|
336
|
-
40: base.cattr_accessor :rescue_templates</p></div>
|
337
|
-
<div class="para"><p>actionpack/lib/action_controller/session/active_record_store.rb
|
338
|
-
60: cattr_accessor :data_column_name
|
339
|
-
170: cattr_accessor :connection
|
340
|
-
173: cattr_accessor :table_name
|
341
|
-
177: cattr_accessor :session_id_column
|
342
|
-
181: cattr_accessor :data_column
|
343
|
-
282: cattr_accessor :session_class</p></div>
|
344
|
-
<div class="para"><p>actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
|
345
|
-
44: cattr_accessor :included_tags, :instance_writer ⇒ false</p></div>
|
346
|
-
<div class="para"><p>actionpack/lib/action_view/base.rb
|
347
|
-
189: cattr_accessor :debug_rjs
|
348
|
-
193: cattr_accessor :warn_cache_misses</p></div>
|
349
|
-
<div class="para"><p>actionpack/lib/action_view/helpers/active_record_helper.rb
|
350
|
-
7: cattr_accessor :field_error_proc</p></div>
|
351
|
-
<div class="para"><p>actionpack/lib/action_view/helpers/form_helper.rb
|
352
|
-
805: cattr_accessor :default_form_builder</p></div>
|
353
|
-
<div class="para"><p>actionpack/lib/action_view/template_handlers/erb.rb
|
354
|
-
47: cattr_accessor :erb_trim_mode</p></div>
|
355
|
-
<div class="para"><p>actionpack/test/active_record_unit.rb
|
356
|
-
5: cattr_accessor :able_to_connect
|
357
|
-
6: cattr_accessor :connected</p></div>
|
358
|
-
<div class="para"><p>actionpack/test/controller/filters_test.rb
|
359
|
-
286: cattr_accessor :execution_log</p></div>
|
360
|
-
<div class="para"><p>actionpack/test/template/form_options_helper_test.rb
|
361
|
-
3:TZInfo::Timezone.cattr_reader :loaded_zones</p></div>
|
362
|
-
<div class="para"><p>activemodel/lib/active_model/errors.rb
|
363
|
-
28: cattr_accessor :default_error_messages</p></div>
|
364
|
-
<div class="para"><p>activemodel/Rakefile
|
365
|
-
19: rdoc.options << <em>—line-numbers</em> << <em>—inline-source</em> << <em>-A cattr_accessor=object</em></p></div>
|
366
|
-
<div class="para"><p>activerecord/lib/active_record/attribute_methods.rb
|
367
|
-
9: base.cattr_accessor :attribute_types_cached_by_default, :instance_writer ⇒ false
|
368
|
-
11: base.cattr_accessor :time_zone_aware_attributes, :instance_writer ⇒ false</p></div>
|
369
|
-
<div class="para"><p>activerecord/lib/active_record/base.rb
|
370
|
-
394: cattr_accessor :logger, :instance_writer ⇒ false
|
371
|
-
443: cattr_accessor :configurations, :instance_writer ⇒ false
|
372
|
-
450: cattr_accessor :primary_key_prefix_type, :instance_writer ⇒ false
|
373
|
-
456: cattr_accessor :table_name_prefix, :instance_writer ⇒ false
|
374
|
-
461: cattr_accessor :table_name_suffix, :instance_writer ⇒ false
|
375
|
-
467: cattr_accessor :pluralize_table_names, :instance_writer ⇒ false
|
376
|
-
473: cattr_accessor :colorize_logging, :instance_writer ⇒ false
|
377
|
-
478: cattr_accessor :default_timezone, :instance_writer ⇒ false
|
378
|
-
487: cattr_accessor :schema_format , :instance_writer ⇒ false
|
379
|
-
491: cattr_accessor :timestamped_migrations , :instance_writer ⇒ false</p></div>
|
380
|
-
<div class="para"><p>activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
|
381
|
-
11: cattr_accessor :connection_handler, :instance_writer ⇒ false</p></div>
|
382
|
-
<div class="para"><p>activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
|
383
|
-
166: cattr_accessor :emulate_booleans</p></div>
|
384
|
-
<div class="para"><p>activerecord/lib/active_record/fixtures.rb
|
385
|
-
498: cattr_accessor :all_loaded_fixtures</p></div>
|
386
|
-
<div class="para"><p>activerecord/lib/active_record/locking/optimistic.rb
|
387
|
-
38: base.cattr_accessor :lock_optimistically, :instance_writer ⇒ false</p></div>
|
388
|
-
<div class="para"><p>activerecord/lib/active_record/migration.rb
|
389
|
-
259: cattr_accessor :verbose</p></div>
|
390
|
-
<div class="para"><p>activerecord/lib/active_record/schema_dumper.rb
|
391
|
-
13: cattr_accessor :ignore_tables</p></div>
|
392
|
-
<div class="para"><p>activerecord/lib/active_record/serializers/json_serializer.rb
|
393
|
-
4: base.cattr_accessor :include_root_in_json, :instance_writer ⇒ false</p></div>
|
394
|
-
<div class="para"><p>activerecord/Rakefile
|
395
|
-
142: rdoc.options << <em>—line-numbers</em> << <em>—inline-source</em> << <em>-A cattr_accessor=object</em></p></div>
|
396
|
-
<div class="para"><p>activerecord/test/cases/lifecycle_test.rb
|
397
|
-
61: cattr_reader :last_inherited</p></div>
|
398
|
-
<div class="para"><p>activerecord/test/cases/mixin_test.rb
|
399
|
-
9: cattr_accessor :forced_now_time</p></div>
|
400
|
-
<div class="para"><p>activeresource/lib/active_resource/base.rb
|
401
|
-
206: cattr_accessor :logger</p></div>
|
402
|
-
<div class="para"><p>activeresource/Rakefile
|
403
|
-
43: rdoc.options << <em>—line-numbers</em> << <em>—inline-source</em> << <em>-A cattr_accessor=object</em></p></div>
|
404
|
-
<div class="para"><p>activesupport/lib/active_support/buffered_logger.rb
|
405
|
-
17: cattr_accessor :silencer</p></div>
|
406
|
-
<div class="para"><p>activesupport/lib/active_support/cache.rb
|
407
|
-
81: cattr_accessor :logger</p></div>
|
408
|
-
<div class="para"><p>activesupport/lib/active_support/core_ext/class/attribute_accessors.rb
|
409
|
-
5:# cattr_accessor :hair_colors
|
410
|
-
10: def cattr_reader(*syms)
|
411
|
-
29: def cattr_writer(*syms)
|
412
|
-
50: def cattr_accessor(*syms)
|
413
|
-
51: cattr_reader(*syms)
|
414
|
-
52: cattr_writer(*syms)</p></div>
|
415
|
-
<div class="para"><p>activesupport/lib/active_support/core_ext/logger.rb
|
416
|
-
34: cattr_accessor :silencer</p></div>
|
417
|
-
<div class="para"><p>activesupport/test/core_ext/class/attribute_accessor_test.rb
|
418
|
-
6: cattr_accessor :foo
|
419
|
-
7: cattr_accessor :bar, :instance_writer ⇒ false</p></div>
|
420
|
-
<div class="para"><p>activesupport/test/core_ext/module/synchronization_test.rb
|
421
|
-
6: @target.cattr_accessor :mutex, :instance_writer ⇒ false</p></div>
|
422
|
-
<div class="para"><p>railties/doc/guides/html/creating_plugins.html
|
423
|
-
786: cattr_accessor <span style="color: #990000">:</span>yaffle_text_field<span style="color: #990000">,</span> <span style="color: #990000">:</span>yaffle_date_field
|
424
|
-
860: cattr_accessor <span style="color: #990000">:</span>yaffle_text_field<span style="color: #990000">,</span> <span style="color: #990000">:</span>yaffle_date_field</p></div>
|
425
|
-
<div class="para"><p>railties/lib/rails_generator/base.rb
|
426
|
-
93: cattr_accessor :logger</p></div>
|
427
|
-
<div class="para"><p>railties/Rakefile
|
428
|
-
265: rdoc.options << <em>—line-numbers</em> << <em>—inline-source</em> << <em>—accessor</em> << <em>cattr_accessor=object</em></p></div>
|
429
|
-
<div class="para"><p>railties/test/rails_info_controller_test.rb
|
430
|
-
12: cattr_accessor :local_request</p></div>
|
431
|
-
<div class="para"><p>Rakefile
|
432
|
-
32: rdoc.options << <em>-A cattr_accessor=object</em></p></div>
|
433
|
-
</div>
|
434
|
-
|
435
|
-
</div>
|
436
|
-
</div>
|
437
|
-
</body>
|
438
|
-
</html>
|