railties 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/CHANGELOG +12 -1
  2. data/guides/output/2_2_release_notes.html +565 -0
  3. data/guides/output/2_3_release_notes.html +713 -0
  4. data/guides/output/3_0_release_notes.html +652 -0
  5. data/guides/output/3_1_release_notes.html +670 -0
  6. data/guides/output/action_controller_overview.html +925 -0
  7. data/guides/output/action_mailer_basics.html +658 -0
  8. data/guides/output/action_view_overview.html +1471 -0
  9. data/guides/output/active_model_basics.html +349 -0
  10. data/guides/output/active_record_basics.html +364 -0
  11. data/guides/output/active_record_querying.html +1272 -0
  12. data/guides/output/active_record_validations_callbacks.html +1292 -0
  13. data/guides/output/active_resource_basics.html +252 -0
  14. data/guides/output/active_support_core_extensions.html +3374 -0
  15. data/guides/output/ajax_on_rails.html +412 -0
  16. data/guides/output/api_documentation_guidelines.html +317 -0
  17. data/guides/output/asset_pipeline.html +691 -0
  18. data/guides/output/association_basics.html +1742 -0
  19. data/guides/output/caching_with_rails.html +533 -0
  20. data/guides/output/command_line.html +662 -0
  21. data/guides/output/configuring.html +811 -0
  22. data/guides/output/contribute.html +216 -0
  23. data/guides/output/contributing_to_ruby_on_rails.html +465 -0
  24. data/guides/output/credits.html +210 -0
  25. data/guides/output/debugging_rails_applications.html +791 -0
  26. data/guides/output/engines.html +673 -0
  27. data/guides/output/form_helpers.html +850 -0
  28. data/guides/output/generators.html +725 -0
  29. data/guides/output/getting_started.html +1980 -0
  30. data/guides/output/i18n.html +1054 -0
  31. data/guides/output/images/belongs_to.png +0 -0
  32. data/guides/output/images/book_icon.gif +0 -0
  33. data/guides/output/images/bullet.gif +0 -0
  34. data/guides/output/images/challenge.png +0 -0
  35. data/guides/output/images/chapters_icon.gif +0 -0
  36. data/guides/output/images/check_bullet.gif +0 -0
  37. data/guides/output/images/credits_pic_blank.gif +0 -0
  38. data/guides/output/images/csrf.png +0 -0
  39. data/guides/output/images/customized_error_messages.png +0 -0
  40. data/guides/output/images/edge_badge.png +0 -0
  41. data/guides/output/images/error_messages.png +0 -0
  42. data/guides/output/images/feature_tile.gif +0 -0
  43. data/guides/output/images/footer_tile.gif +0 -0
  44. data/guides/output/images/fxn.png +0 -0
  45. data/guides/output/images/grey_bullet.gif +0 -0
  46. data/guides/output/images/habtm.png +0 -0
  47. data/guides/output/images/has_many.png +0 -0
  48. data/guides/output/images/has_many_through.png +0 -0
  49. data/guides/output/images/has_one.png +0 -0
  50. data/guides/output/images/has_one_through.png +0 -0
  51. data/guides/output/images/header_backdrop.png +0 -0
  52. data/guides/output/images/header_tile.gif +0 -0
  53. data/guides/output/images/i18n/demo_html_safe.png +0 -0
  54. data/guides/output/images/i18n/demo_localized_pirate.png +0 -0
  55. data/guides/output/images/i18n/demo_translated_en.png +0 -0
  56. data/guides/output/images/i18n/demo_translated_pirate.png +0 -0
  57. data/guides/output/images/i18n/demo_translation_missing.png +0 -0
  58. data/guides/output/images/i18n/demo_untranslated.png +0 -0
  59. data/guides/output/images/icons/README +5 -0
  60. data/guides/output/images/icons/callouts/1.png +0 -0
  61. data/guides/output/images/icons/callouts/10.png +0 -0
  62. data/guides/output/images/icons/callouts/11.png +0 -0
  63. data/guides/output/images/icons/callouts/12.png +0 -0
  64. data/guides/output/images/icons/callouts/13.png +0 -0
  65. data/guides/output/images/icons/callouts/14.png +0 -0
  66. data/guides/output/images/icons/callouts/15.png +0 -0
  67. data/guides/output/images/icons/callouts/2.png +0 -0
  68. data/guides/output/images/icons/callouts/3.png +0 -0
  69. data/guides/output/images/icons/callouts/4.png +0 -0
  70. data/guides/output/images/icons/callouts/5.png +0 -0
  71. data/guides/output/images/icons/callouts/6.png +0 -0
  72. data/guides/output/images/icons/callouts/7.png +0 -0
  73. data/guides/output/images/icons/callouts/8.png +0 -0
  74. data/guides/output/images/icons/callouts/9.png +0 -0
  75. data/guides/output/images/icons/caution.png +0 -0
  76. data/guides/output/images/icons/example.png +0 -0
  77. data/guides/output/images/icons/home.png +0 -0
  78. data/guides/output/images/icons/important.png +0 -0
  79. data/guides/output/images/icons/next.png +0 -0
  80. data/guides/output/images/icons/note.png +0 -0
  81. data/guides/output/images/icons/prev.png +0 -0
  82. data/guides/output/images/icons/tip.png +0 -0
  83. data/guides/output/images/icons/up.png +0 -0
  84. data/guides/output/images/icons/warning.png +0 -0
  85. data/guides/output/images/jaimeiniesta.jpg +0 -0
  86. data/guides/output/images/nav_arrow.gif +0 -0
  87. data/guides/output/images/polymorphic.png +0 -0
  88. data/guides/output/images/posts_index.png +0 -0
  89. data/guides/output/images/radar.png +0 -0
  90. data/guides/output/images/rails_guides_logo.gif +0 -0
  91. data/guides/output/images/rails_logo_remix.gif +0 -0
  92. data/guides/output/images/rails_welcome.png +0 -0
  93. data/guides/output/images/session_fixation.png +0 -0
  94. data/guides/output/images/tab_grey.gif +0 -0
  95. data/guides/output/images/tab_info.gif +0 -0
  96. data/guides/output/images/tab_note.gif +0 -0
  97. data/guides/output/images/tab_red.gif +0 -0
  98. data/guides/output/images/tab_yellow.gif +0 -0
  99. data/guides/output/images/tab_yellow.png +0 -0
  100. data/guides/output/images/validation_error_messages.png +0 -0
  101. data/guides/output/images/vijaydev.jpg +0 -0
  102. data/guides/output/index.html +300 -0
  103. data/guides/output/initialization.html +1087 -0
  104. data/guides/output/javascripts/guides.js +7 -0
  105. data/guides/output/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
  106. data/guides/output/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
  107. data/guides/output/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
  108. data/guides/output/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
  109. data/guides/output/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
  110. data/guides/output/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
  111. data/guides/output/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
  112. data/guides/output/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
  113. data/guides/output/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
  114. data/guides/output/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
  115. data/guides/output/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
  116. data/guides/output/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
  117. data/guides/output/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
  118. data/guides/output/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
  119. data/guides/output/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
  120. data/guides/output/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
  121. data/guides/output/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
  122. data/guides/output/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
  123. data/guides/output/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
  124. data/guides/output/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
  125. data/guides/output/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
  126. data/guides/output/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
  127. data/guides/output/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
  128. data/guides/output/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
  129. data/guides/output/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
  130. data/guides/output/javascripts/syntaxhighlighter/shCore.js +17 -0
  131. data/guides/output/layout.html +312 -0
  132. data/guides/output/layouts_and_rendering.html +1257 -0
  133. data/guides/output/migrations.html +751 -0
  134. data/guides/output/nested_model_forms.html +350 -0
  135. data/guides/output/performance_testing.html +858 -0
  136. data/guides/output/plugins.html +590 -0
  137. data/guides/output/rails_application_templates.html +368 -0
  138. data/guides/output/rails_on_rack.html +408 -0
  139. data/guides/output/routing.html +1246 -0
  140. data/guides/output/ruby_on_rails_guides_guidelines.html +218 -0
  141. data/guides/output/security.html +968 -0
  142. data/guides/output/stylesheets/fixes.css +16 -0
  143. data/guides/output/stylesheets/main.css +445 -0
  144. data/guides/output/stylesheets/print.css +52 -0
  145. data/guides/output/stylesheets/reset.css +43 -0
  146. data/guides/output/stylesheets/style.css +13 -0
  147. data/guides/output/stylesheets/syntaxhighlighter/shCore.css +226 -0
  148. data/guides/output/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
  149. data/guides/output/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
  150. data/guides/output/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
  151. data/guides/output/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
  152. data/guides/output/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
  153. data/guides/output/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
  154. data/guides/output/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
  155. data/guides/output/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
  156. data/guides/output/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
  157. data/guides/output/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
  158. data/guides/output/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
  159. data/guides/output/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
  160. data/guides/output/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
  161. data/guides/output/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
  162. data/guides/output/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
  163. data/guides/output/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
  164. data/guides/output/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
  165. data/guides/output/testing.html +1182 -0
  166. data/lib/rails/generators/rails/app/app_generator.rb +1 -1
  167. data/lib/rails/generators/rails/app/templates/public/javascripts/rails.js +86 -75
  168. data/lib/rails/tasks/documentation.rake +1 -1
  169. data/lib/rails/version.rb +1 -1
  170. metadata +457 -293
@@ -0,0 +1,216 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+
8
+ <title>Ruby on Rails Guides: Contribute to the Rails Guides</title>
9
+
10
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
11
+ <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
12
+
13
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shCore.css" />
14
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shThemeRailsGuides.css" />
15
+
16
+ <link rel="stylesheet" type="text/css" href="stylesheets/fixes.css" />
17
+ </head>
18
+ <body class="guide">
19
+ <div id="topNav">
20
+ <div class="wrapper">
21
+ <strong>More at <a href="http://rubyonrails.org/">rubyonrails.org:</a> </strong>
22
+ <a href="http://rubyonrails.org/">Overview</a> |
23
+ <a href="http://rubyonrails.org/download">Download</a> |
24
+ <a href="http://rubyonrails.org/deploy">Deploy</a> |
25
+ <a href="https://github.com/rails/rails">Code</a> |
26
+ <a href="http://rubyonrails.org/screencasts">Screencasts</a> |
27
+ <a href="http://rubyonrails.org/documentation">Documentation</a> |
28
+ <a href="http://rubyonrails.org/ecosystem">Ecosystem</a> |
29
+ <a href="http://rubyonrails.org/community">Community</a> |
30
+ <a href="http://weblog.rubyonrails.org/">Blog</a>
31
+ </div>
32
+ </div>
33
+ <div id="header">
34
+ <div class="wrapper clearfix">
35
+ <h1><a href="index.html" title="Return to home page">Guides.rubyonrails.org</a></h1>
36
+ <p class="hide"><a href="#mainCol">Skip navigation</a>.</p>
37
+ <ul class="nav">
38
+ <li><a href="index.html">Home</a></li>
39
+ <li class="index"><a href="index.html" onclick="guideMenu(); return false;" id="guidesMenu">Guides Index</a>
40
+ <div id="guides" class="clearfix" style="display: none;">
41
+ <hr />
42
+ <dl class="L">
43
+ <dt>Start Here</dt>
44
+ <dd><a href="getting_started.html">Getting Started with Rails</a></dd>
45
+ <dt>Models</dt>
46
+ <dd><a href="migrations.html">Rails Database Migrations</a></dd>
47
+ <dd><a href="active_record_validations_callbacks.html">Active Record Validations and Callbacks</a></dd>
48
+ <dd><a href="association_basics.html">Active Record Associations</a></dd>
49
+ <dd><a href="active_record_querying.html">Active Record Query Interface</a></dd>
50
+ <dt>Views</dt>
51
+ <dd><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dd>
52
+ <dd><a href="form_helpers.html">Action View Form Helpers</a></dd>
53
+ <dt>Controllers</dt>
54
+ <dd><a href="action_controller_overview.html">Action Controller Overview</a></dd>
55
+ <dd><a href="routing.html">Rails Routing from the Outside In</a></dd>
56
+ </dl>
57
+ <dl class="R">
58
+ <dt>Digging Deeper</dt>
59
+ <dd><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dd>
60
+ <dd><a href="i18n.html">Rails Internationalization API</a></dd>
61
+ <dd><a href="action_mailer_basics.html">Action Mailer Basics</a></dd>
62
+ <dd><a href="testing.html">Testing Rails Applications</a></dd>
63
+ <dd><a href="security.html">Securing Rails Applications</a></dd>
64
+ <dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
65
+ <dd><a href="performance_testing.html">Performance Testing Rails Applications</a></dd>
66
+ <dd><a href="configuring.html">Configuring Rails Applications</a></dd>
67
+ <dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
68
+ <dd><a href="caching_with_rails.html">Caching with Rails</a></dd>
69
+
70
+ <dt>Extending Rails</dt>
71
+ <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
72
+ <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
73
+ <dd><a href="generators.html">Creating and Customizing Rails Generators</a></dd>
74
+
75
+ <dt>Contributing to Ruby on Rails</dt>
76
+ <dd><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dd>
77
+ <dd><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dd>
78
+ <dd><a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a></dd>
79
+
80
+ <dt>Release Notes</dt>
81
+ <dd><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dd>
82
+ <dd><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dd>
83
+ <dd><a href="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</a></dd>
84
+ </dl>
85
+ </div>
86
+ </li>
87
+ <li><a href="contribute.html">Contribute</a></li>
88
+ <li><a href="credits.html">Credits</a></li>
89
+ </ul>
90
+ </div>
91
+ </div>
92
+ <hr class="hide" />
93
+
94
+ <div id="feature">
95
+ <div class="wrapper">
96
+ <h2>Contribute to the Rails Guides</h2>
97
+ <p>Rails Guides aim to improve the Rails documentation and to make the barrier to entry as low as possible. A reasonably experienced developer should be able to use the guides to come up to speed on Rails quickly. Our sponsors have contributed prizes for those who write an entire guide, but there are many other ways to contribute.</p>
98
+
99
+ <div id="subCol">
100
+ <h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
101
+ <ol class="chapters">
102
+ <li><a href="#how-to-contribute">How to Contribute?</a></li><li><a href="#what-to-contribute">What to Contribute?</a></li><li><a href="#how-is-the-process">How is the process?</a></li><li><a href="#prizes">Prizes</a></li><li><a href="#rules">Rules</a></li><li><a href="#translations">Translations</a></li><li><a href="#mailing-list">Mailing List</a></li><li><a href="#contact">Contact</a></li></ol></div>
103
+ </div>
104
+ </div>
105
+
106
+ <div id="container">
107
+ <div class="wrapper">
108
+ <div id="mainCol">
109
+ <h3 id="how-to-contribute">1 How to Contribute?</h3>
110
+ <ul>
111
+ <li>We have an open commit policy: anyone is welcome to contribute and to review contributions.</li>
112
+ <li><a href="https://github.com/lifo/docrails">docrails is hosted on GitHub</a> and has public write access.</li>
113
+ <li>Guides are written in Textile, and reside at <tt>railties/guides/source</tt> in the docrails project.</li>
114
+ <li>Follow the <a href="https://wiki.github.com/lifo/docrails/rails-guides-conventions">Rails Guides Conventions</a>.</li>
115
+ <li>Assets are stored in the <tt>railties/guides/assets</tt> directory.</li>
116
+ <li>Sample format : <a href="https://github.com/lifo/docrails/blob/3e56a3832415476fdd1cb963980d0ae390ac1ed3/railties/guides/source/association_basics.textile">Active Record Associations</a>.</li>
117
+ <li>Sample output : <a href="association_basics.html">Active Record Associations</a>.</li>
118
+ <li>You can build the Guides during testing by running <tt>bundle exec rake generate_guides</tt> in the <tt>railties</tt> directory.</li>
119
+ <li>You&#8217;re encouraged to validate <span class="caps">XHTML</span> for the generated guides before committing your changes by running <tt>bundle exec rake validate_guides</tt> in the <tt>railties</tt> directory.</li>
120
+ <li>Edge guides <a href="http://edgeguides.rubyonrails.org/">can be consulted online</a>. That website is generated periodically from docrails.</li>
121
+ </ul>
122
+ <h3 id="what-to-contribute">2 What to Contribute?</h3>
123
+ <ul>
124
+ <li>We need authors, editors, proofreaders, and translators. Adding a single paragraph of quality content to a guide is a good way to get started.</li>
125
+ <li>The easiest way to start is by improving an existing guide:
126
+ <ul>
127
+ <li>Improve the structure to make it more coherent.</li>
128
+ <li>Add missing information.</li>
129
+ <li>Correct any factual errors.</li>
130
+ <li>Fix typos or improve style.</li>
131
+ <li>Bring it up to date with the latest Edge Rails.</li>
132
+ </ul></li>
133
+ <li>We&#8217;re also open to suggestions for entire new guides:
134
+ <ul>
135
+ <li>Contact lifo or fxn to get your idea approved. See the Contact section below.</li>
136
+ <li>If you&#8217;re the main author on a significant guide, you&#8217;re eligible for the prizes.</li>
137
+ </ul></li>
138
+ </ul>
139
+ <h3 id="how-is-the-process">3 How is the process?</h3>
140
+ <ul>
141
+ <li>The preferred way to contribute is to commit to docrails directly.</li>
142
+ <li>A new guide is only edited by its author until finished though.</li>
143
+ <li>If you are writing a new guide freely commit to docrails partial work and ping lifo or fxn when done with a first draft.</li>
144
+ <li>Guides reviewers will then provide feedback, some of it possibly in form of direct commits to agilize the process.</li>
145
+ <li>Eventually the guide will be approved and added to the index.</li>
146
+ </ul>
147
+ <h3 id="prizes">4 Prizes</h3>
148
+ <p>For each completed guide, the lead contributor will receive all of the following prizes:</p>
149
+ <ul>
150
+ <li>$200 from Caboose Rails Documentation Project.</li>
151
+ <li>1 year of GitHub Micro account worth $84.</li>
152
+ <li>1 year of <span class="caps">RPM</span> Basic (Production performance management) for up to 10 hosts worth 12 months x $40 per host x 10 hosts = $4800. And also, savings of $45 per host per month over list price to upgrade to advanced product.</li>
153
+ </ul>
154
+ <h3 id="rules">5 Rules</h3>
155
+ <ul>
156
+ <li>Guides are licensed under a Creative Commons Attribution-Share Alike 3.0 License.</li>
157
+ <li>If you&#8217;re not sure whether a guide is actively being worked on, stop by <span class="caps">IRC</span> and ask.</li>
158
+ <li>If the same guide writer wants to write multiple guides, that&#8217;s ideally the situation we&#8217;d love to be in! However, that guide writer will only receive the cash prize for all the subsequent guides (and not the GitHub or <span class="caps">RPM</span> prizes).</li>
159
+ <li>Our review team will have the final say on whether the guide is complete and of good enough quality.</li>
160
+ </ul>
161
+ <p>All authors should read and follow the <a href="ruby_on_rails_guides_guidelines.html">Rails Guides Conventions</a> and the <a href="api_documentation_guidelines.html">Rails <span class="caps">API</span> Documentation Conventions</a>.</p>
162
+ <h3 id="translations">6 Translations</h3>
163
+ <p>The translation effort for the Rails Guides is just getting underway. We know about projects to translate the Guides into Spanish, Portuguese, Polish, and French. For more details or to get involved see the <a href="https://wiki.github.com/lifo/docrails/translating-rails-guides">Translating Rails Guides</a> page.</p>
164
+ <h3 id="mailing-list">7 Mailing List</h3>
165
+ <p><a href="http://groups.google.com/group/rubyonrails-docs">Ruby on Rails: Documentation</a> is the mailing list for all the guides/documentation related discussions.</p>
166
+ <h3 id="contact">8 Contact</h3>
167
+ <ul>
168
+ <li><span class="caps">IRC</span> : #docrails channel in irc.freenode.net</li>
169
+ <li>Twitter: <a href="http://twitter.com/docrails">@docrails</a>, <a href="http://twitter.com/lifo">@lifo</a>, <a href="http://twitter.com/fxn">@fxn</a></li>
170
+ <li>Email : pratiknaik aT gmail, fxn aT hashref dot com</li>
171
+ </ul>
172
+
173
+ <h3>Feedback</h3>
174
+ <p>
175
+ You're encouraged to help improve the quality of this guide.
176
+ </p>
177
+ <p>
178
+ If you see any typos or factual errors you are confident to
179
+ patch, please clone <a href="https://github.com/lifo/docrails">docrails</a>
180
+ and push the change yourself. That branch of Rails has public write access.
181
+ Commits are still reviewed, but that happens after you've submitted your
182
+ contribution. <a href="https://github.com/lifo/docrails">docrails</a> is
183
+ cross-merged with master periodically.
184
+ </p>
185
+ <p>
186
+ You may also find incomplete content, or stuff that is not up to date.
187
+ Please do add any missing documentation for master. Check the
188
+ <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>
189
+ for style and conventions.
190
+ </p>
191
+ <p>And last but not least, any kind of discussion regarding Ruby on Rails
192
+ documentation is very welcome in the <a href="http://groups.google.com/group/rubyonrails-docs">rubyonrails-docs mailing list</a>.
193
+ </p>
194
+ </div>
195
+ </div>
196
+ </div>
197
+
198
+ <hr class="hide" />
199
+ <div id="footer">
200
+ <div class="wrapper">
201
+ <p>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a> License</p>
202
+ <p>"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.</p>
203
+ </div>
204
+ </div>
205
+
206
+ <script type="text/javascript" src="javascripts/guides.js"></script>
207
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shCore.js"></script>
208
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushRuby.js"></script>
209
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushXml.js"></script>
210
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushSql.js"></script>
211
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushPlain.js"></script>
212
+ <script type="text/javascript">
213
+ SyntaxHighlighter.all()
214
+ </script>
215
+ </body>
216
+ </html>
@@ -0,0 +1,465 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+
8
+ <title>Ruby on Rails Guides: Contributing to Ruby on Rails</title>
9
+
10
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
11
+ <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
12
+
13
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shCore.css" />
14
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shThemeRailsGuides.css" />
15
+
16
+ <link rel="stylesheet" type="text/css" href="stylesheets/fixes.css" />
17
+ </head>
18
+ <body class="guide">
19
+ <div id="topNav">
20
+ <div class="wrapper">
21
+ <strong>More at <a href="http://rubyonrails.org/">rubyonrails.org:</a> </strong>
22
+ <a href="http://rubyonrails.org/">Overview</a> |
23
+ <a href="http://rubyonrails.org/download">Download</a> |
24
+ <a href="http://rubyonrails.org/deploy">Deploy</a> |
25
+ <a href="https://github.com/rails/rails">Code</a> |
26
+ <a href="http://rubyonrails.org/screencasts">Screencasts</a> |
27
+ <a href="http://rubyonrails.org/documentation">Documentation</a> |
28
+ <a href="http://rubyonrails.org/ecosystem">Ecosystem</a> |
29
+ <a href="http://rubyonrails.org/community">Community</a> |
30
+ <a href="http://weblog.rubyonrails.org/">Blog</a>
31
+ </div>
32
+ </div>
33
+ <div id="header">
34
+ <div class="wrapper clearfix">
35
+ <h1><a href="index.html" title="Return to home page">Guides.rubyonrails.org</a></h1>
36
+ <p class="hide"><a href="#mainCol">Skip navigation</a>.</p>
37
+ <ul class="nav">
38
+ <li><a href="index.html">Home</a></li>
39
+ <li class="index"><a href="index.html" onclick="guideMenu(); return false;" id="guidesMenu">Guides Index</a>
40
+ <div id="guides" class="clearfix" style="display: none;">
41
+ <hr />
42
+ <dl class="L">
43
+ <dt>Start Here</dt>
44
+ <dd><a href="getting_started.html">Getting Started with Rails</a></dd>
45
+ <dt>Models</dt>
46
+ <dd><a href="migrations.html">Rails Database Migrations</a></dd>
47
+ <dd><a href="active_record_validations_callbacks.html">Active Record Validations and Callbacks</a></dd>
48
+ <dd><a href="association_basics.html">Active Record Associations</a></dd>
49
+ <dd><a href="active_record_querying.html">Active Record Query Interface</a></dd>
50
+ <dt>Views</dt>
51
+ <dd><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dd>
52
+ <dd><a href="form_helpers.html">Action View Form Helpers</a></dd>
53
+ <dt>Controllers</dt>
54
+ <dd><a href="action_controller_overview.html">Action Controller Overview</a></dd>
55
+ <dd><a href="routing.html">Rails Routing from the Outside In</a></dd>
56
+ </dl>
57
+ <dl class="R">
58
+ <dt>Digging Deeper</dt>
59
+ <dd><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dd>
60
+ <dd><a href="i18n.html">Rails Internationalization API</a></dd>
61
+ <dd><a href="action_mailer_basics.html">Action Mailer Basics</a></dd>
62
+ <dd><a href="testing.html">Testing Rails Applications</a></dd>
63
+ <dd><a href="security.html">Securing Rails Applications</a></dd>
64
+ <dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
65
+ <dd><a href="performance_testing.html">Performance Testing Rails Applications</a></dd>
66
+ <dd><a href="configuring.html">Configuring Rails Applications</a></dd>
67
+ <dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
68
+ <dd><a href="caching_with_rails.html">Caching with Rails</a></dd>
69
+ <dd><a href="asset_pipeline.html">Asset Pipeline</a></dd>
70
+
71
+ <dt>Extending Rails</dt>
72
+ <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
73
+ <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
74
+ <dd><a href="generators.html">Creating and Customizing Rails Generators</a></dd>
75
+
76
+ <dt>Contributing to Ruby on Rails</dt>
77
+ <dd><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dd>
78
+ <dd><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dd>
79
+ <dd><a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a></dd>
80
+
81
+ <dt>Release Notes</dt>
82
+ <dd><a href="3_1_release_notes.html">Ruby on Rails 3.1 Release Notes</a></dd>
83
+ <dd><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dd>
84
+ <dd><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dd>
85
+ <dd><a href="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</a></dd>
86
+ </dl>
87
+ </div>
88
+ </li>
89
+ <li><a href="contributing_to_ruby_on_rails.html">Contribute</a></li>
90
+ <li><a href="credits.html">Credits</a></li>
91
+ </ul>
92
+ </div>
93
+ </div>
94
+ <hr class="hide" />
95
+
96
+ <div id="feature">
97
+ <div class="wrapper">
98
+ <h2>Contributing to Ruby on Rails</h2>
99
+ <p>This guide covers ways in which <em>you</em> can become a part of the ongoing development of Ruby on Rails. After reading it, you should be familiar with:</p>
100
+ <ul>
101
+ <li>Using GitHub to report issues</li>
102
+ <li>Cloning master and running the test suite</li>
103
+ <li>Helping to resolve existing issues</li>
104
+ <li>Contributing to the Ruby on Rails documentation</li>
105
+ <li>Contributing to the Ruby on Rails code</li>
106
+ </ul>
107
+ <p>Ruby on Rails is not &#8220;someone else&#8217;s framework.&#8221; Over the years, hundreds of people have contributed to Ruby on Rails ranging from a single character to massive architectural changes or significant documentation. All with the goal of making Ruby on Rails better for everyone. Even if you don&#8217;t feel up to writing code or documentation yet, there are a variety of other ways that you can contribute, from reporting issues to testing patches.</p>
108
+
109
+ <div id="subCol">
110
+ <h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
111
+ <ol class="chapters">
112
+ <li><a href="#reporting-an-issue">Reporting an Issue</a><ul><li><a href="#creating-a-bug-report">Creating a Bug Report</a></li> <li><a href="#special-treatment-for-security-issues">Special Treatment for Security Issues</a></li> <li><a href="#what-about-feature-requests">What About Feature Requests?</a></li></ul></li><li><a href="#running-the-test-suite">Running the Test Suite</a><ul><li><a href="#install-git">Install git</a></li> <li><a href="#clone-the-ruby-on-rails-repository">Clone the Ruby on Rails Repository</a></li> <li><a href="#set-up-and-run-the-tests">Set up and Run the Tests</a></li> <li><a href="#warnings">Warnings</a></li> <li><a href="#testing-active-record">Testing Active Record</a></li> <li><a href="#older-versions-of-ruby-on-rails">Older versions of Ruby on Rails</a></li></ul></li><li><a href="#helping-to-resolve-existing-issues">Helping to Resolve Existing Issues</a><ul><li><a href="#verifying-bug-reports">Verifying Bug Reports</a></li> <li><a href="#testing-patches">Testing Patches</a></li></ul></li><li><a href="#contributing-to-the-rails-documentation">Contributing to the Rails Documentation</a></li><li><a href="#contributing-to-the-rails-code">Contributing to the Rails Code</a><ul><li><a href="#clone-the-rails-repository">Clone the Rails Repository</a></li> <li><a href="#write-your-code">Write Your Code</a></li> <li><a href="#follow-the-coding-conventions">Follow the Coding Conventions</a></li> <li><a href="#sanity-check">Sanity Check</a></li> <li><a href="#commit-your-changes">Commit Your Changes</a></li> <li><a href="#update-master">Update master</a></li> <li><a href="#fork">Fork</a></li> <li><a href="#issue-a-pull-request">Issue a Pull Request</a></li> <li><a href="#get-some-feedback">Get Some Feedback</a></li> <li><a href="#iterate-as-necessary">Iterate as Necessary</a></li></ul></li><li><a href="#rails-contributors">Rails Contributors</a></li></ol></div>
113
+ </div>
114
+ </div>
115
+
116
+ <div id="container">
117
+ <div class="wrapper">
118
+ <div id="mainCol">
119
+ <h3 id="reporting-an-issue">1 Reporting an Issue</h3>
120
+ <p>Ruby on Rails uses <a href="https://github.com/rails/rails/issues">GitHub Issue Tracking</a> to track issues (primarily bugs and contributions of new code). If you&#8217;ve found a bug in Ruby on Rails, this is the place to start. You&#8217;ll need to create a (free) GitHub account in order to either submit an issue, comment on them or create pull requests.</p>
121
+ <div class="note"><p>Bugs in the most recent released version of Ruby on Rails are likely to get the most attention. Also, the Rails core team is always interested in feedback from those who can take the time to test <em>edge Rails</em> (the code for the version of Rails that is currently under development). Later in this guide you&#8217;ll find out how to get edge Rails for testing.</p></div>
122
+ <h4 id="creating-a-bug-report">1.1 Creating a Bug Report</h4>
123
+ <p>If you&#8217;ve found a problem in Ruby on Rails which is not a security risk do a search in GitHub Issues in case it was already reported. If you find no issue addressing it you can <a href="https://github.com/rails/rails/issues/new">add a new one</a>. (See the next section for reporting security issues.)</p>
124
+ <p>At the minimum, your issue report needs a title and descriptive text. But that&#8217;s only a minimum. You should include as much relevant information as possible. You need to at least post the code sample that has the issue. Even better is to include a unit test that shows how the expected behavior is not occurring. Your goal should be to make it easy for yourself &#8211; and others &#8211; to replicate the bug and figure out a fix.</p>
125
+ <p>Then don&#8217;t get your hopes up. Unless you have a &#8220;Code Red, Mission Critical, The World is Coming to an End&#8221; kind of bug, you&#8217;re creating this issue report in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the issue report will automatically see any activity or that others will jump to fix it. Creating an issue like this is mostly to help yourself start on the path of fixing the problem and for others to confirm it with a &#8220;I&#8217;m having this problem too&#8221; comment.</p>
126
+ <h4 id="special-treatment-for-security-issues">1.2 Special Treatment for Security Issues</h4>
127
+ <div class="warning"><p>Please do not report security vulnerabilities with public GitHub issue reports. The <a href="http://rubyonrails.org/security">Rails security policy page</a> details the procedure to follow for security issues.</p></div>
128
+ <h4 id="what-about-feature-requests">1.3 What About Feature Requests?</h4>
129
+ <p>Please don&#8217;t put &#8220;feature request&#8221; items into GitHub Issues. If there&#8217;s a new feature that you want to see added to Ruby on Rails, you&#8217;ll need to write the code yourself &#8211; or convince someone else to partner with you to write the code. Later in this guide you&#8217;ll find detailed instructions for proposing a patch to Ruby on Rails. If you enter a wishlist item in GitHub Issues with no code, you can expect it to be marked &#8220;invalid&#8221; as soon as it&#8217;s reviewed.</p>
130
+ <h3 id="running-the-test-suite">2 Running the Test Suite</h3>
131
+ <p>To move on from submitting bugs to helping resolve existing issues or contributing your own code to Ruby on Rails, you <em>must</em> be able to run its test suite. In this section of the guide you&#8217;ll learn how to set up the tests on your own computer.</p>
132
+ <h4 id="install-git">2.1 Install git</h4>
133
+ <p>Ruby on Rails uses git for source code control. The <a href="http://git-scm.com/">git homepage</a> has installation instructions. There are a variety of resources on the net that will help you get familiar with git:</p>
134
+ <ul>
135
+ <li><a href="http://www.kernel.org/pub/software/scm/git/docs/everyday.html">Everyday Git</a> will teach you just enough about git to get by.</li>
136
+ <li>The <a href="https://peepcode.com/products/git">PeepCode screencast</a> on git ($9) is easier to follow.</li>
137
+ <li><a href="http://help.github.com">GitHub</a> offers links to a variety of git resources.</li>
138
+ <li><a href="http://progit.org/book/">Pro Git</a> is an entire book about git with a Creative Commons license.</li>
139
+ </ul>
140
+ <h4 id="clone-the-ruby-on-rails-repository">2.2 Clone the Ruby on Rails Repository</h4>
141
+ <p>Navigate to the folder where you want the Ruby on Rails source code (it will create its own <tt>rails</tt> subdirectory) and run:</p>
142
+ <div class="code_container">
143
+ <pre class="brush: plain; gutter: false; toolbar: false">
144
+ $ git clone git://github.com/rails/rails.git
145
+ $ cd rails
146
+ </pre>
147
+ </div>
148
+ <h4 id="set-up-and-run-the-tests">2.3 Set up and Run the Tests</h4>
149
+ <p>The test suite must pass with any submitted code. No matter whether you are writing a new patch, or evaluating someone else&#8217;s, you need to be able to run the tests.</p>
150
+ <p>Install first libxml2 and libxslt together with their development files for Nokogiri. In Ubuntu that&#8217;s</p>
151
+ <div class="code_container">
152
+ <pre class="brush: plain; gutter: false; toolbar: false">
153
+ $ sudo apt-get install libxml2 libxml2-dev libxslt1-dev
154
+ </pre>
155
+ </div>
156
+ <p>Also, SQLite3 and its development files for the <tt>sqlite3-ruby</tt> gem, in Ubuntu you&#8217;re done with</p>
157
+ <div class="code_container">
158
+ <pre class="brush: plain; gutter: false; toolbar: false">
159
+ $ sudo apt-get install sqlite3 libsqlite3-dev
160
+ </pre>
161
+ </div>
162
+ <p>Get a recent version of <a href="http://gembundler.com/">Bundler</a>:</p>
163
+ <div class="code_container">
164
+ <pre class="brush: plain; gutter: false; toolbar: false">
165
+ $ gem install bundler
166
+ </pre>
167
+ </div>
168
+ <p>and run:</p>
169
+ <div class="code_container">
170
+ <pre class="brush: plain; gutter: false; toolbar: false">
171
+ $ bundle install --without db
172
+ </pre>
173
+ </div>
174
+ <p>This command will install all dependencies except the MySQL and PostgreSQL Ruby drivers. We will come back at these soon. With dependencies installed, you can run the test suite with:</p>
175
+ <div class="code_container">
176
+ <pre class="brush: plain; gutter: false; toolbar: false">
177
+ $ rake test
178
+ </pre>
179
+ </div>
180
+ <p>You can also run tests for a specific framework, like Action Pack, by going into its directory and executing the same command:</p>
181
+ <div class="code_container">
182
+ <pre class="brush: plain; gutter: false; toolbar: false">
183
+ $ cd actionpack
184
+ $ rake test
185
+ </pre>
186
+ </div>
187
+ <p>If you want to run tests from the specific directory use the <tt>TEST_DIR</tt> environment variable. For example, this will run tests inside <tt>railties/test/generators</tt> directory only:</p>
188
+ <div class="code_container">
189
+ <pre class="brush: plain; gutter: false; toolbar: false">
190
+ $ cd railties
191
+ $ TEST_DIR=generators rake test
192
+ </pre>
193
+ </div>
194
+ <h4 id="warnings">2.4 Warnings</h4>
195
+ <p>The test suite runs with warnings enabled. Ideally Ruby on Rails should issue no warning, but there may be a few, and also some from third-party libraries. Please ignore (or fix!) them if any, and submit patches that do not issue new warnings.</p>
196
+ <p>As of this writing they are specially noisy with Ruby 1.9. If you are sure about what you are doing and would like to have a more clear output, there&#8217;s a way to override the flag:</p>
197
+ <div class="code_container">
198
+ <pre class="brush: plain; gutter: false; toolbar: false">
199
+ $ RUBYOPT=-W0 rake test
200
+ </pre>
201
+ </div>
202
+ <h4 id="testing-active-record">2.5 Testing Active Record</h4>
203
+ <p>The test suite of Active Record attempts to run four times, once for SQLite3, once for each of the two MySQL gems (<tt>mysql</tt> and <tt>mysql2</tt>), and once for PostgreSQL. We are going to see now how to setup the environment for them.</p>
204
+ <div class="warning"><p>If you&#8217;re working with Active Record code, you <em>must</em> ensure that the tests pass for at least MySQL, PostgreSQL, and SQLite3. Subtle differences between the various adapters have been behind the rejection of many patches that looked OK when tested only against MySQL.</p></div>
205
+ <h5 id="set-up-database-configuration">2.5.1 Set up Database Configuration</h5>
206
+ <p>The Active Record test suite requires a custom config file: <tt>activerecord/test/config.yml</tt>. An example is provided in <tt>activerecord/test/config.example.yml</tt> which can be copied and used as needed for your environment.</p>
207
+ <h5 id="sqlite3">2.5.2 SQLite3</h5>
208
+ <p>The gem <tt>sqlite3-ruby</tt> does not belong to the &#8220;db&#8221; group indeed, if you followed the instructions above you&#8217;re ready. This is how you run the Active Record test suite only for SQLite3:</p>
209
+ <div class="code_container">
210
+ <pre class="brush: plain; gutter: false; toolbar: false">
211
+ $ cd activerecord
212
+ $ rake test_sqlite3
213
+ </pre>
214
+ </div>
215
+ <h5 id="mysql-and-postgresql">2.5.3 MySQL and PostgreSQL</h5>
216
+ <p>To be able to run the suite for MySQL and PostgreSQL we need their gems. Install first the servers, their client libraries, and their development files. In Ubuntu just run</p>
217
+ <div class="code_container">
218
+ <pre class="brush: plain; gutter: false; toolbar: false">
219
+ $ sudo apt-get install mysql-server libmysqlclient15-dev
220
+ $ sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev
221
+ </pre>
222
+ </div>
223
+ <p>After that run:</p>
224
+ <div class="code_container">
225
+ <pre class="brush: plain; gutter: false; toolbar: false">
226
+ $ rm .bundle/config
227
+ $ bundle install
228
+ </pre>
229
+ </div>
230
+ <p>We need first to delete <tt>.bundle/config</tt> because Bundler remembers in that file that we didn&#8217;t want to install the &#8220;db&#8221; group (alternatively you can edit the file).</p>
231
+ <p>In order to be able to run the test suite against MySQL you need to create a user named <tt>rails</tt> with privileges on the test databases:</p>
232
+ <div class="code_container">
233
+ <pre class="brush: plain; gutter: false; toolbar: false">
234
+ mysql&gt; GRANT ALL PRIVILEGES ON activerecord_unittest.*
235
+ to 'rails'@'localhost';
236
+ mysql&gt; GRANT ALL PRIVILEGES ON activerecord_unittest2.*
237
+ to 'rails'@'localhost';
238
+ </pre>
239
+ </div>
240
+ <p>and create the test databases:</p>
241
+ <div class="code_container">
242
+ <pre class="brush: plain; gutter: false; toolbar: false">
243
+ $ cd activerecord
244
+ $ rake mysql:build_databases
245
+ </pre>
246
+ </div>
247
+ <p>PostgreSQL&#8217;s authentication works differently. A simple way to setup the development environment for example is to run with your development account</p>
248
+ <div class="code_container">
249
+ <pre class="brush: plain; gutter: false; toolbar: false">
250
+ $ sudo -u postgres createuser --superuser $USER
251
+ </pre>
252
+ </div>
253
+ <p>and after that create the test databases with</p>
254
+ <div class="code_container">
255
+ <pre class="brush: plain; gutter: false; toolbar: false">
256
+ $ cd activerecord
257
+ $ rake postgresql:build_databases
258
+ </pre>
259
+ </div>
260
+ <div class="note"><p>Using the rake task to create the test databases ensures they have the correct character set and collation.</p></div>
261
+ <p>If you’re using another database, check the files under <tt>activerecord/test/connections</tt> for default connection information. You can edit these files if you <em>must</em> on your machine to provide different credentials, but obviously you should not push any such changes back to Rails.</p>
262
+ <p>You can now run tests as you did for <tt>sqlite3</tt>, the tasks are</p>
263
+ <div class="code_container">
264
+ <pre class="brush: plain; gutter: false; toolbar: false">
265
+ test_mysql
266
+ test_mysql2
267
+ test_postgresql
268
+ </pre>
269
+ </div>
270
+ <p>respectively. As we mentioned before</p>
271
+ <div class="code_container">
272
+ <pre class="brush: plain; gutter: false; toolbar: false">
273
+ $ rake test
274
+ </pre>
275
+ </div>
276
+ <p>will now run the four of them in turn.</p>
277
+ <p>You can also invoke <tt>test_jdbcmysql</tt>, <tt>test_jdbcsqlite3</tt> or <tt>test_jdbcpostgresql</tt>. Check out the file <tt>activerecord/RUNNING_UNIT_TESTS</tt> for information on running more targeted database tests, or the file <tt>ci/ci_build.rb</tt> to see the test suite that the continuous integration server runs.</p>
278
+ <h4 id="older-versions-of-ruby-on-rails">2.6 Older versions of Ruby on Rails</h4>
279
+ <p>If you want to add a fix to older versions of Ruby on Rails, you&#8217;ll need to set up and switch to your own local tracking branch. Here is an example to switch to the 3-0-stable branch:</p>
280
+ <div class="code_container">
281
+ <pre class="brush: plain; gutter: false; toolbar: false">
282
+ $ git branch --track 3-0-stable origin/3-0-stable
283
+ $ git checkout 3-0-stable
284
+ </pre>
285
+ </div>
286
+ <div class="info"><p>You may want to <a href="http://qugstart.com/blog/git-and-svn/add-colored-git-branch-name-to-your-shell-prompt/">put your git branch name in your shell prompt</a> to make it easier to remember which version of the code you&#8217;re working with.</p></div>
287
+ <h3 id="helping-to-resolve-existing-issues">3 Helping to Resolve Existing Issues</h3>
288
+ <p>As a next step beyond reporting issues, you can help the core team resolve existing issues. If you check the <a href="https://github.com/rails/rails/issues?sort=created&amp;direction=desc&amp;state=open&amp;page=1">Everyone&#8217;s Issues</a> list in GitHub Issues, you&#8217;ll find lots of issues already requiring attention. What can you do for these? Quite a bit, actually:</p>
289
+ <h4 id="verifying-bug-reports">3.1 Verifying Bug Reports</h4>
290
+ <p>For starters, it helps to just verify bug reports. Can you reproduce the reported issue on your own computer? If so, you can add a comment to the issue saying that you&#8217;re seeing the same thing.</p>
291
+ <p>If something is very vague, can you help squish it down into something specific? Maybe you can provide additional information to help reproduce a bug, or eliminate needless steps that aren&#8217;t required to help demonstrate the problem.</p>
292
+ <p>If you find a bug report without a test, it&#8217;s very useful to contribute a failing test. This is also a great way to get started exploring the source code: looking at the existing test files will teach you how to write more tests. New tests are best contributed in the form of a patch, as explained later on in the &#8220;Contributing to the Rails Code&#8221; section.</p>
293
+ <p>Anything you can do to make bug reports more succinct or easier to reproduce is a help to folks trying to write code to fix those bugs &#8211; whether you end up writing the code yourself or not.</p>
294
+ <h4 id="testing-patches">3.2 Testing Patches</h4>
295
+ <p>You can also help out by examining pull requests that have been submitted to Ruby on Rails via GitHub. To apply someone&#8217;s changes you need to first create a dedicated branch:</p>
296
+ <div class="code_container">
297
+ <pre class="brush: plain; gutter: false; toolbar: false">
298
+ $ git checkout -b testing_branch
299
+ </pre>
300
+ </div>
301
+ <p>Then you can use their remote branch to update your codebase. For example, let&#8217;s say the GitHub user JohnSmith has forked and pushed to the topic branch located at https://github.com/JohnSmith/rails.</p>
302
+ <div class="code_container">
303
+ <pre class="brush: plain; gutter: false; toolbar: false">
304
+ $ git remote add JohnSmith git://github.com/JohnSmith/rails.git
305
+ $ git pull JohnSmith topic
306
+ </pre>
307
+ </div>
308
+ <p>After applying their branch, test it out! Here are some things to think about:</p>
309
+ <ul>
310
+ <li>Does the change actually work?</li>
311
+ <li>Are you happy with the tests? Can you follow what they&#8217;re testing? Are there any tests missing?</li>
312
+ <li>Does it have proper documentation coverage? Should documentation elsewhere be updated?</li>
313
+ <li>Do you like the implementation? Can you think of a nicer or faster way to implement a part of their change?</li>
314
+ </ul>
315
+ <p>Once you&#8217;re happy that the pull request contains a good change, comment on the GitHub issue indicating your approval. Your comment should indicate that you like the change and what you like about it. Something like:</p>
316
+ <blockquote>
317
+ <p>I like the way you&#8217;ve restructured that code in generate_finder_sql, much nicer. The tests look good too.</p>
318
+ </blockquote>
319
+ <p>If your comment simply says &#8220;+1&#8221;, then odds are that other reviewers aren&#8217;t going to take it too seriously. Show that you took the time to review the pull request.</p>
320
+ <h3 id="contributing-to-the-rails-documentation">4 Contributing to the Rails Documentation</h3>
321
+ <p>Ruby on Rails has two main sets of documentation: The guides help you to learn Ruby on Rails, and the <span class="caps">API</span> is a reference.</p>
322
+ <p>You can help improve the Rails guides by making them more coherent, adding missing information, correcting factual errors, fixing typos, bringing it up to date with the latest edge Rails. To get involved in the translation of Rails guides, please see <a href="https://wiki.github.com/lifo/docrails/translating-rails-guides">Translating Rails Guides</a>.</p>
323
+ <p>If you&#8217;re confident about your changes, you can push them yourself directly via <a href="https://github.com/lifo/docrails">docrails</a>. docrails is a branch with an <strong>open commit policy</strong> and public write access. Commits to docrails are still reviewed, but that happens after they are pushed. docrails is merged with master regularly, so you are effectively editing the Ruby on Rails documentation.</p>
324
+ <p>If you are unsure of the documentation changes, you can create an issue in the <a href="https://github.com/rails/rails/issues">Rails</a> issues tracker on GitHub.</p>
325
+ <p>When working with documentation, please take into account the <a href="api_documentation_guidelines.html"><span class="caps">API</span> Documentation Guidelines</a> and the <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>.</p>
326
+ <div class="note"><p>As explained earlier, ordinary code patches should have proper documentation coverage. docrails is only used for isolated documentation improvements.</p></div>
327
+ <div class="warning"><p>docrails has a very strict policy: no code can be touched whatsoever, no matter how trivial or small the change. Only RDoc and guides can be edited via docrails. Also, CHANGELOGs should never be edited in docrails.</p></div>
328
+ <h3 id="contributing-to-the-rails-code">5 Contributing to the Rails Code</h3>
329
+ <h4 id="clone-the-rails-repository">5.1 Clone the Rails Repository</h4>
330
+ <p>The first thing you need to do to be able to contribute code is to clone the repository:</p>
331
+ <div class="code_container">
332
+ <pre class="brush: plain; gutter: false; toolbar: false">
333
+ $ git clone git://github.com/rails/rails.git
334
+ </pre>
335
+ </div>
336
+ <p>and create a dedicated branch:</p>
337
+ <div class="code_container">
338
+ <pre class="brush: plain; gutter: false; toolbar: false">
339
+ $ cd rails
340
+ $ git checkout -b my_new_branch
341
+ </pre>
342
+ </div>
343
+ <p>It doesn’t really matter what name you use, because this branch will only exist on your local computer and your personal repository on Github. It won&#8217;t be part of the Rails git repository.</p>
344
+ <h4 id="write-your-code">5.2 Write Your Code</h4>
345
+ <p>Now get busy and add or edit code. You’re on your branch now, so you can write whatever you want (you can check to make sure you’re on the right branch with <tt>git branch -a</tt>). But if you’re planning to submit your change back for inclusion in Rails, keep a few things in mind:</p>
346
+ <ul>
347
+ <li>Get the code right</li>
348
+ <li>Use Rails idioms and helpers</li>
349
+ <li>Include tests that fail without your code, and pass with it</li>
350
+ <li>Update the documentation, the surrounding one, examples elsewhere, guides, whatever is affected by your contribution</li>
351
+ </ul>
352
+ <h4 id="follow-the-coding-conventions">5.3 Follow the Coding Conventions</h4>
353
+ <p>Rails follows a simple set of coding style conventions.</p>
354
+ <ul>
355
+ <li>Two spaces, no tabs.</li>
356
+ <li>No trailing whitespace. Blank lines should not have any space.</li>
357
+ <li>Indent after private/protected.</li>
358
+ <li>Prefer <tt>&amp;&amp;</tt>/<tt>||</tt> over <tt>and</tt>/<tt>or</tt>.</li>
359
+ <li>Prefer class &lt;&lt; self block over self.method for class methods.</li>
360
+ <li><tt>MyClass.my_method(my_arg)</tt> not <tt>my_method( my_arg )</tt> or <tt>my_method my_arg</tt>.</li>
361
+ <li>a = b and not a=b.</li>
362
+ <li>Follow the conventions you see used in the source already.</li>
363
+ </ul>
364
+ <p>These are some guidelines and please use your best judgment in using them.</p>
365
+ <h4 id="sanity-check">5.4 Sanity Check</h4>
366
+ <p>You should not be the only person who looks at the code before you submit it. You know at least one other Rails developer, right? Show them what you’re doing and ask for feedback. Doing this in private before you push a patch out publicly is the “smoke test” for a patch: if you can’t convince one other developer of the beauty of your code, you’re unlikely to convince the core team either.</p>
367
+ <p>You might also want to check out the <a href="http://wiki.railsbridge.org/projects/railsbridge/wiki/BugMash">RailsBridge BugMash</a> as a way to get involved in a group effort to improve Rails. This can help you get started and help check your code when you&#8217;re writing your first patches.</p>
368
+ <h4 id="commit-your-changes">5.5 Commit Your Changes</h4>
369
+ <p>When you&#8217;re happy with the code on your computer, you need to commit the changes to git:</p>
370
+ <div class="code_container">
371
+ <pre class="brush: plain; gutter: false; toolbar: false">
372
+ $ git commit -a -m &quot;Here is a commit message on what I changed in this commit&quot;
373
+ </pre>
374
+ </div>
375
+ <h4 id="update-master">5.6 Update master</h4>
376
+ <p>It’s pretty likely that other changes to master have happened while you were working. Go get them:</p>
377
+ <div class="code_container">
378
+ <pre class="brush: plain; gutter: false; toolbar: false">
379
+ $ git checkout master
380
+ $ git pull
381
+ </pre>
382
+ </div>
383
+ <p>Now reapply your patch on top of the latest changes:</p>
384
+ <div class="code_container">
385
+ <pre class="brush: plain; gutter: false; toolbar: false">
386
+ $ git checkout my_new_branch
387
+ $ git rebase master
388
+ </pre>
389
+ </div>
390
+ <p>No conflicts? Tests still pass? Change still seems reasonable to you? Then move on.</p>
391
+ <h4 id="fork">5.7 Fork</h4>
392
+ <p>Navigate to the Rails <a href="https://github.com/rails/rails">GitHub repository</a> and press &#8220;Fork&#8221; in the upper right hand corner.</p>
393
+ <p>Add the new remote to your local repository on your local machine:</p>
394
+ <div class="code_container">
395
+ <pre class="brush: plain; gutter: false; toolbar: false">
396
+ $ git remote add mine git@github.com:&lt;your user name&gt;/rails.git
397
+ </pre>
398
+ </div>
399
+ <p>Push to your remote:</p>
400
+ <div class="code_container">
401
+ <pre class="brush: plain; gutter: false; toolbar: false">
402
+ $ git push mine my_new_branch
403
+ </pre>
404
+ </div>
405
+ <h4 id="issue-a-pull-request">5.8 Issue a Pull Request</h4>
406
+ <p>Navigate to the Rails repository you just pushed to (e.g. https://github.com/your-user-name/rails) and press &#8220;Pull Request&#8221; in the upper right hand corner.</p>
407
+ <p>Write your branch name in branch field (is filled with master by default) and press &#8220;Update Commit Range&#8221;</p>
408
+ <p>Ensure the changesets you introduced are included in the &#8220;Commits&#8221; tab and that the &#8220;Files Changed&#8221; incorporate all of your changes.</p>
409
+ <p>Fill in some details about your potential patch including a meaningful title. When finished, press &#8220;Send pull request.&#8221; Rails Core will be notified about your submission.</p>
410
+ <h4 id="get-some-feedback">5.9 Get Some Feedback</h4>
411
+ <p>Now you need to get other people to look at your patch, just as you&#8217;ve looked at other people&#8217;s patches. You can use the <a href="http://groups.google.com/group/rubyonrails-core/">rubyonrails-core mailing list</a> or the #rails-contrib channel on <span class="caps">IRC</span> freenode for this. You might also try just talking to Rails developers that you know.</p>
412
+ <h4 id="iterate-as-necessary">5.10 Iterate as Necessary</h4>
413
+ <p>It’s entirely possible that the feedback you get will suggest changes. Don’t get discouraged: the whole point of contributing to an active open source project is to tap into community knowledge. If people are encouraging you to tweak your code, then it’s worth making the tweaks and resubmitting. If the feedback is that your code doesn’t belong in the core, you might still think about releasing it as a plugin.</p>
414
+ <p>And then&#8230;think about your next contribution!</p>
415
+ <h3 id="rails-contributors">6 Rails Contributors</h3>
416
+ <p>All contributions, either via master or docrails, get credit in <a href="http://contributors.rubyonrails.org">Rails Contributors</a>.</p>
417
+
418
+ <h3>Feedback</h3>
419
+ <p>
420
+ You're encouraged to help improve the quality of this guide.
421
+ </p>
422
+ <p>
423
+ If you see any typos or factual errors you are confident to
424
+ patch, please clone <a href="https://github.com/lifo/docrails">docrails</a>
425
+ and push the change yourself. That branch of Rails has public write access.
426
+ Commits are still reviewed, but that happens after you've submitted your
427
+ contribution. <a href="https://github.com/lifo/docrails">docrails</a> is
428
+ cross-merged with master periodically.
429
+ </p>
430
+ <p>
431
+ You may also find incomplete content, or stuff that is not up to date.
432
+ Please do add any missing documentation for master. Check the
433
+ <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>
434
+ for style and conventions.
435
+ </p>
436
+ <p>
437
+ If for whatever reason you spot something to fix but cannot patch it yourself, please
438
+ <a href="https://github.com/rails/rails/issues">open an issue</a>.
439
+ </p>
440
+ <p>And last but not least, any kind of discussion regarding Ruby on Rails
441
+ documentation is very welcome in the <a href="http://groups.google.com/group/rubyonrails-docs">rubyonrails-docs mailing list</a>.
442
+ </p>
443
+ </div>
444
+ </div>
445
+ </div>
446
+
447
+ <hr class="hide" />
448
+ <div id="footer">
449
+ <div class="wrapper">
450
+ <p>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0</a> License</p>
451
+ <p>"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.</p>
452
+ </div>
453
+ </div>
454
+
455
+ <script type="text/javascript" src="javascripts/guides.js"></script>
456
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shCore.js"></script>
457
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushRuby.js"></script>
458
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushXml.js"></script>
459
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushSql.js"></script>
460
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushPlain.js"></script>
461
+ <script type="text/javascript">
462
+ SyntaxHighlighter.all()
463
+ </script>
464
+ </body>
465
+ </html>