diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 36c49d9c911ae..66a5d59857fc0 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -9,8 +9,8 @@ module ActionView #:nodoc: # = Action View Base # - # Action View templates can be written in several ways. If the template file has a .erb (or .rhtml) extension then it uses a mixture of ERb - # (included in Ruby) and HTML. If the template file has a .builder (or .rxml) extension then Jim Weirich's Builder::XmlMarkup library is used. + # Action View templates can be written in several ways. If the template file has a .erb extension then it uses a mixture of ERb + # (included in Ruby) and HTML. If the template file has a .builder extension then Jim Weirich's Builder::XmlMarkup library is used. # # == ERB # @@ -94,10 +94,10 @@ module ActionView #:nodoc: # # Any method with a block will be treated as an XML markup tag with nested markup in the block. For example, the following: # - # xml.div { + # xml.div do # xml.h1(@person.name) # xml.p(@person.bio) - # } + # end # # would produce something like: # diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index b34c223b3188a..bc85f07ecc3b8 100644 --- a/railties/guides/source/action_controller_overview.textile +++ b/railties/guides/source/action_controller_overview.textile @@ -16,7 +16,7 @@ h3. What Does a Controller Do? Action Controller is the C in MVC. After routing has determined which controller to use for a request, your controller is responsible for making sense of the request and producing the appropriate output. Luckily, Action Controller does most of the groundwork for you and uses smart conventions to make this as straightforward as possible. -For most conventional RESTful applications, the controller will receive the request (this is invisible to you as the developer), fetch or save data from a model and use a view to create HTML output. If your controller needs to do things a little differently, that's not a problem, this is just the most common way for a controller to work. +For most conventional "RESTful":http://en.wikipedia.org/wiki/Representational_state_transfer applications, the controller will receive the request (this is invisible to you as the developer), fetch or save data from a model and use a view to create HTML output. If your controller needs to do things a little differently, that's not a problem, this is just the most common way for a controller to work. A controller can thus be thought of as a middle man between models and views. It makes the model data available to the view so it can display that data to the user, and it saves or updates data from the user to the model. diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile index 3fa6c059e1e54..7a3da134acb25 100644 --- a/railties/guides/source/command_line.textile +++ b/railties/guides/source/command_line.textile @@ -420,7 +420,7 @@ The +doc:+ namespace has the tools to generate documentation for your app, API d h4. +notes+ -+rake notes+ will search through your code for comments beginning with FIXME, OPTIMIZE or TODO. The search is only done in files with extension +.builder+, +.rb+, +.rxml+, +.rhtml+ and +.erb+ for both default and custom annotations. ++rake notes+ will search through your code for comments beginning with FIXME, OPTIMIZE or TODO. The search is only done in files with extension +.builder+, +.rb+ and +.erb+ for both default and custom annotations. $ rake notes diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 37ead2bff212d..92cb0774def00 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -336,7 +336,7 @@ It’s pretty likely that other changes to master have happened while you were w $ git checkout master -$ git pull +$ git pull --rebase Now reapply your patch on top of the latest changes: diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 6c050e27d6691..a0ab34960d6cf 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -673,9 +673,9 @@ h5. Linking to JavaScript Files with the +javascript_include_tag+ The +javascript_include_tag+ helper returns an HTML +script+ tag for each source provided. -If you are using Rails with the "Asset Pipeline":http://guides.rubyonrails.org/asset_pipeline.html enabled, this helper will generate a link to +/assets/javascripts/+ rather than +public/javascripts+ which was used in earlier versions of Rails. This link is then served by the Sprockets gem, which was introduced in Rails 3.1. +If you are using Rails with the "Asset Pipeline":asset_pipeline.html enabled, this helper will generate a link to +/assets/javascripts/+ rather than +public/javascripts+ which was used in earlier versions of Rails. This link is then served by the Sprockets gem, which was introduced in Rails 3.1. -A JavaScript file within a Rails application or Rails engine goes in one of three locations: +app/assets+, +lib/assets+ or +vendor/assets+. These locations are explained in detail in the "Asset Organisation section in the Asset Pipeline Guide":http://guides.rubyonrails.org/asset_pipeline.html#asset-organization +A JavaScript file within a Rails application or Rails engine goes in one of three locations: +app/assets+, +lib/assets+ or +vendor/assets+. These locations are explained in detail in the "Asset Organization section in the Asset Pipeline Guide":asset_pipeline.html#asset-organization You can specify a full path relative to the document root, or a URL, if you prefer. For example, to link to a JavaScript file that is inside a directory called +javascripts+ inside of one of +app/assets+, +lib/assets+ or +vendor/assets+, you would do this: @@ -724,7 +724,7 @@ Outputting +script+ tags such as this: These two files for jQuery, +jquery.js+ and +jquery_ujs.js+ must be placed inside +public/javascripts+ if the application doesn't use the asset pipeline. These files can be downloaded from the "jquery-rails repository on GitHub":https://github.com/indirect/jquery-rails/tree/master/vendor/assets/javascripts -WARNING: If you are using the Asset Pipeline, this tag will render a +script+ tag for an asset called +defaults.js+, which would not exist in your application unless you've explicitly defined it to be. +WARNING: If you are using the asset pipeline, this tag will render a +script+ tag for an asset called +defaults.js+, which would not exist in your application unless you've explicitly defined it to be. And you can in any case override the +:defaults+ expansion in config/application.rb: @@ -744,9 +744,9 @@ And use them by referencing them exactly like +:defaults+: <%= javascript_include_tag :projects %> -When using :defaults, if an application.js file exists in public/javascripts it will be included as well at then end. +When using :defaults, if an application.js file exists in public/javascripts it will be included as well at the end. -Also, if the Asset Pipeline is disabled, the +:all+ expansion loads every JavaScript file in +public/javascripts+: +Also, if the asset pipeline is disabled, the +:all+ expansion loads every JavaScript file in +public/javascripts+: <%= javascript_include_tag :all %> @@ -777,19 +777,23 @@ You can even use dynamic paths such as +cache/#{current_site}/main/display+. h5. Linking to CSS Files with the +stylesheet_link_tag+ -The +stylesheet_link_tag+ helper returns an HTML +<link>+ tag for each source provided. Rails looks in +public/stylesheets+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/stylesheets/main.css+: +The +stylesheet_link_tag+ helper returns an HTML +<link>+ tag for each source provided. + +If you are using Rails with the "Asset Pipeline" enabled, this helper will generate a link to +/assets/stylesheets/+. This link is then processed by the Sprockets gem. A stylesheet file can be stored in one of three locations: +app/assets+, +lib/assets+ or +vendor/assets+. + +You can specify a full path relative to the document root, or a URL. For example, to link to a stylesheet file that is inside a directory called +stylesheets+ inside of one of +app/assets+, +lib/assets+ or +vendor/assets+, you would do this: <%= stylesheet_link_tag "main" %> -To include +public/stylesheets/main.css+ and +public/stylesheets/columns.css+: +To include +app/assets/stylesheets/main.css+ and +app/assets/stylesheets/columns.css+: <%= stylesheet_link_tag "main", "columns" %> -To include +public/stylesheets/main.css+ and +public/photos/columns.css+: +To include +app/assets/stylesheets/main.css+ and +app/assets/stylesheets/photos/columns.css+: <%= stylesheet_link_tag "main", "/photos/columns" %> @@ -807,7 +811,7 @@ By default, the +stylesheet_link_tag+ creates links with +media="screen" rel="st <%= stylesheet_link_tag "main_print", :media => "print" %> -The +all+ option links every CSS file in +public/stylesheets+: +If the asset pipeline is disabled, the +all+ option links every CSS file in +public/stylesheets+: <%= stylesheet_link_tag :all %> diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index e67be0ae9f027..92356edf90a4b 100644 --- a/railties/guides/source/migrations.textile +++ b/railties/guides/source/migrations.textile @@ -541,7 +541,7 @@ Note that running the +db:migrate+ also invokes the +db:schema:dump+ task, which will update your db/schema.rb file to match the structure of your database. If you specify a target version, Active Record will run the required migrations -(up or down or change) until it has reached the specified version. The version +(up, down or change) until it has reached the specified version. The version is the numerical prefix on the migration's filename. For example, to migrate to version 20080906120000 run