diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index d40e0840ce26c1417e93583fec7c86bd8e8b6e53..5a1e8b124726e06550afbe2fd950576bd91e5a9f 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -478,7 +478,6 @@ javascript_include_tag :monkey # => - h5. register_stylesheet_expansion Register one or more stylesheet files to be included when symbol is passed to +stylesheet_link_tag+. This method is typically intended to be called from plugin initialization to register stylesheet files that the plugin installed in +public/stylesheets+. diff --git a/railties/guides/source/active_model_basics.textile b/railties/guides/source/active_model_basics.textile index f3a2b2edbcd8bb55fac1797c8a97ef0b98794bbe..3c19fb5177db2ddc18195e43de141bfcf584a5e1 100644 --- a/railties/guides/source/active_model_basics.textile +++ b/railties/guides/source/active_model_basics.textile @@ -168,7 +168,6 @@ Track what was the previous value of the attribute. person.first_name_was #=> "First Name" - Track both previous and current value of the changed attribute. Returns an array if changed else returns nil #attr_name_change diff --git a/railties/guides/source/active_record_basics.textile b/railties/guides/source/active_record_basics.textile index 3e46e7df9f3cfd57d44e4a2f04b7910215dc5070..cab8c80866f0ba63a39d5730b012115be52cc9e5 100644 --- a/railties/guides/source/active_record_basics.textile +++ b/railties/guides/source/active_record_basics.textile @@ -204,7 +204,6 @@ Likewise, once retrieved an Active Record object can be destroyed which removes user.destroy - h3. Validations Active Record allows you to validate the state of a model before it gets written into the database. There are several methods that you can use to check your models and validate that an attribute value is not empty, is unique and not already in the database, follows a specific format and many more. You can learn more about validations in the "Active Record Validations and Callbacks guide":active_record_validations_callbacks.html#validations-overview. diff --git a/railties/guides/source/ajax_on_rails.textile b/railties/guides/source/ajax_on_rails.textile index 8b72e20c3301c0cf2d6035af9a387b67e10f911f..77f7661deb5735e15738753c47d3f5e5f9d6cfdc 100644 --- a/railties/guides/source/ajax_on_rails.textile +++ b/railties/guides/source/ajax_on_rails.textile @@ -24,16 +24,12 @@ h4. Standard HTML communication vs AJAX How do 'standard' and AJAX requests differ, why does this matter for understanding AJAX on Rails (tie in for *_remote helpers, the next section) - - - - - h3. Built-in Rails Helpers Rails' JavaScript framework of choice is "Prototype":http://www.prototypejs.org. Prototype is a generic-purpose JavaScript framework that aims to ease the development of dynamic web applications by offering DOM manipulation, AJAX and other JavaScript functionality ranging from utility functions to object oriented constructs. It is not specifically written for any language, so Rails provides a set of helpers to enable seamless integration of Prototype with your Rails views. To get access to these helpers, all you have to do is to include the prototype framework in your pages - typically in your master layout, application.html.erb - like so: + javascript_include_tag 'prototype' @@ -59,7 +55,6 @@ link_to_remote "Add to cart", * The very first parameter, a string, is the text of the link which appears on the page. - * The second parameter, the +options+ hash is the most interesting part as it has the AJAX specific stuff: ** *:url* This is the only parameter that is always required to generate the simplest remote link (technically speaking, it is not required, you can pass an empty +options+ hash to +link_to_remote+ - but in this case the URL used for the POST request will be equal to your current URL which is probably not your intention). This URL points to your AJAX action handler. The URL is typically specified by Rails REST view helpers, but you can use the +url_for+ format too. ** *:update* Specifying a DOM id of the element we would like to update. The above example demonstrates the simplest way of accomplishing this - however, we are in trouble if the server responds with an error message because that will be injected into the page too! However, Rails has a solution for this situation: @@ -193,7 +188,6 @@ end What happens here is that by specifying the Content-Type header variable, we instruct the browser to evaluate the text we are sending over (rather than displaying it as plain text, which is the default behavior). - h3. Testing JavaScript JavaScript testing reminds me the definition of the world 'classic' by Mark Twain: "A classic is something that everybody wants to have read and nobody wants to read." It's similar with JavaScript testing: everyone would like to have it, yet it's not done by too much developers as it is tedious, complicated, there is a proliferation of tools and no consensus/accepted best practices, but we will nevertheless take a stab at it: diff --git a/railties/guides/source/api_documentation_guidelines.textile b/railties/guides/source/api_documentation_guidelines.textile index 9c4df2d6b8aa02b4ae94a3c3546a5e1d8ba66973..3ebf0e10f1732d317c611f283f5f3d4a14cfa252 100644 --- a/railties/guides/source/api_documentation_guidelines.textile +++ b/railties/guides/source/api_documentation_guidelines.textile @@ -106,7 +106,6 @@ routes.rb # NO RAILS_ROOT/config/routes.rb # NO - h3. Fonts h4. Fixed-width Font @@ -188,4 +187,3 @@ self.class_eval %{ h3. Changelog * July 17, 2010: ported from the docrails wiki and revised by "Xavier Noria":credits.html#fxn - diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 74a9e497f2b69ca23c45fac79628cf43402e407f..8094ba18f2b1c911a48a71bc2cd2c5eeb9711632 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -27,7 +27,6 @@ config.assets.enabled = false It is recommended that you use the defaults for all new apps. - h4. Main Features The first feature of the pipeline is to concatenate assets. This is important in a production environment, as it reduces the number of requests that a browser must make to render a web page. While Rails already has a feature to concatenate these types of assetsi -- by placing +:cache => true+ at the end of tags such as +javascript_include_tag+ and +stylesheet_link_tag+ -- many people do not use it. @@ -80,7 +79,6 @@ More reading: * "Optimize caching":http://code.google.com/speed/page-speed/docs/caching.html * "Revving Filenames: don’t use querystring":http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/ - h3. How to Use the Asset Pipeline In previous versions of Rails, all assets were located in subdirectories of +public+ such as +images+, +javascripts+ and +stylesheets+. With the asset pipeline, the preferred location for these assets is now the +app/assets+ directory. Files in this directory are served by the Sprockets middleware included in the sprockets gem. @@ -324,7 +322,6 @@ When files are precompiled, Sprockets also creates a "Gzip":http://en.wikipedia. TODO: Apache instructions - h3. Customizing the Pipeline @@ -372,7 +369,6 @@ To enable this, pass a +new+ Object to the config option in +application.rb+: config.assets.css_compressor = Transformer.new - h4. Changing the _assets_ Path The public path that Sprockets uses by default is +/assets+. diff --git a/railties/guides/source/caching_with_rails.textile b/railties/guides/source/caching_with_rails.textile index ae569114413d3b54b6690642f5caa5b863caa529..693303950d177f9595c786a91a5a7da356b81348 100644 --- a/railties/guides/source/caching_with_rails.textile +++ b/railties/guides/source/caching_with_rails.textile @@ -404,7 +404,6 @@ h3. Further reading * "Scaling Rails Screencasts":http://railslab.newrelic.com/scaling-rails - h3. Changelog * Feb 17, 2011: Document 3.0.0 changes to ActiveSupport::Cache @@ -415,4 +414,3 @@ h3. Changelog * December 27, 2008: Typo fixes * November 23, 2008: Incremental updates with various suggested changes and formatting cleanup * September 15, 2008: Initial version by Aditya Chadha - diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index e6ec061c9a14a695decd08f0842cfde2549c7a60..4706725bb6c2dc86d4170d59732306ce9085f7c0 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -104,7 +104,6 @@ $ cd railties $ TEST_DIR=generators rake test - h4. Warnings 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. diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile index bf2a7369a78e3dbe357db19e9ecfea88f1f596cb..c277f5723ac83ca95819f6b027c9482dc42b3ffa 100644 --- a/railties/guides/source/form_helpers.textile +++ b/railties/guides/source/form_helpers.textile @@ -342,7 +342,6 @@ output: When parsing POSTed data, Rails will take into account the special +_method+ parameter and acts as if the HTTP method was the one specified inside it ("PUT" in this example). - h3. Making Select Boxes with Ease Select boxes in HTML require a significant amount of markup (one +OPTION+ element for each option to choose from), therefore it makes the most sense for them to be dynamically generated. diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 3cca383616ec71c2fdd44440e4665b2ae3cad9f3..092ca90a30eafffd1cc1d78374186c1ad9c949e8 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -116,7 +116,6 @@ need to know anything about them to continue with this guide. * Active Support * Railties - h5. Action Pack Action Pack is a single gem that contains Action Controller, Action View and @@ -1633,7 +1632,6 @@ Authentication challenge !images/challenge.png(Basic HTTP Authentication Challenge)! - h3. Building a Multi-Model Form Another feature of your average blog is the ability to tag posts. To implement diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 5a6343472c9839dfd58c0e98ba0671fb83bc1349..4b6b08bcec7711e1f1d2b954b9bf87b957a581d4 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -796,7 +796,6 @@ h5. Active Support Methods * +Array#to_sentence+ uses format settings as given in the "support.array":https://github.com/rails/rails/blob/master/activesupport/lib/active_support/locale/en.yml#L30 scope. - h3. Customize your I18n Setup h4. Using Different Backends diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile index 49d75134484fd569d0b3c306baa4f66384ae57bd..b93c4f35acfc08a6958fa5f766607c17bede188b 100644 --- a/railties/guides/source/initialization.textile +++ b/railties/guides/source/initialization.textile @@ -761,7 +761,6 @@ def subclasses end - The +config+ method used at the top of +I18n::Railtie+ is defined on +Rails::Railtie+ and is defined like this: @@ -848,7 +847,7 @@ The +Collection+ class in +railties/lib/rails/initializable.rb+ inherits from +A The +initializers_chain+ method referenced in the +initializers_for+ method is defined like this: - + def initializers_chain initializers = Collection.new ancestors.reverse_each do | klass | diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index 9da12e2e18f494aa8d5908a7b49f2228a8b50631..6fcc3cf4a249da171ada1ec2cbd71744429f794c 100644 --- a/railties/guides/source/migrations.textile +++ b/railties/guides/source/migrations.textile @@ -300,6 +300,7 @@ change_table :products do |t| t.rename :upccode, :upc_code end + removes the +description+ and +name+ columns, creates a +part_number+ column and adds an index on it. Finally it renames the +upccode+ column. This is the same as doing diff --git a/railties/guides/source/plugins.textile b/railties/guides/source/plugins.textile index 188423861db5858c31b36577147c0fa7dc53c269..d3f9783fa68ad35bb8109f1f46152957b1cd512f 100644 --- a/railties/guides/source/plugins.textile +++ b/railties/guides/source/plugins.textile @@ -386,6 +386,7 @@ ActiveRecord::Base.send :include, Yaffle::ActsAsYaffle Run +rake+ one final time and you should see: + 7 tests, 7 assertions, 0 failures, 0 errors, 0 skips @@ -426,6 +427,7 @@ require 'yaffle' You can test this by changing to the Rails application that you added the plugin to and starting a rails console. Once in the console we can check to see if the String has an instance method of to_squawk. + $ cd my_app $ rails console diff --git a/railties/guides/source/security.textile b/railties/guides/source/security.textile index 1f6ff88c1f70661d85cf0bb723acec87541747fd..04d1d0bda88adc259ba3e7402549bce0ffe1c488 100644 --- a/railties/guides/source/security.textile +++ b/railties/guides/source/security.textile @@ -80,7 +80,6 @@ This will also be a good idea, if you modify the structure of an object and old * _(highlight)Critical data should not be stored in session_. If the user clears his cookies or closes the browser, they will be lost. And with a client-side session storage, the user can read the data. - h4. Session Storage -- _Rails provides several storage mechanisms for the session hashes. The most important are ActiveRecordStore and CookieStore._