diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-12-06 23:05:43 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-12-06 23:05:43 +0530 |
commit | 7eb596cddd75b379ca2ca25955b0bd2af77a89bc (patch) | |
tree | fe4dac360edc71ec5e8f0487a113b59f139505fd /railties/guides/source | |
parent | 9be2353fac89729b839df3d0538b607f3fc1aa87 (diff) | |
parent | 89647a305f882cde0e87b0136ad9a1b6d3bd4fbd (diff) | |
download | rails-7eb596cddd75b379ca2ca25955b0bd2af77a89bc.tar.gz rails-7eb596cddd75b379ca2ca25955b0bd2af77a89bc.tar.bz2 rails-7eb596cddd75b379ca2ca25955b0bd2af77a89bc.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source')
5 files changed, 17 insertions, 13 deletions
diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index b34c223b31..bc85f07ecc 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 3fa6c059e1..7a3da134ac 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. <shell> $ 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 37ead2bff2..92cb0774de 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 <shell> $ git checkout master -$ git pull +$ git pull --rebase </shell> 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 6c050e27d6..a0ab34960d 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 <tt>config/application.rb</tt>: @@ -744,9 +744,9 @@ And use them by referencing them exactly like +:defaults+: <%= javascript_include_tag :projects %> </erb> -When using <tt>:defaults</tt>, if an <tt>application.js</tt> file exists in <tt>public/javascripts</tt> it will be included as well at then end. +When using <tt>:defaults</tt>, if an <tt>application.js</tt> file exists in <tt>public/javascripts</tt> 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+: <erb> <%= 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: <erb> <%= stylesheet_link_tag "main" %> </erb> -To include +public/stylesheets/main.css+ and +public/stylesheets/columns.css+: +To include +app/assets/stylesheets/main.css+ and +app/assets/stylesheets/columns.css+: <erb> <%= stylesheet_link_tag "main", "columns" %> </erb> -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+: <erb> <%= 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" %> </erb> -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+: <erb> <%= stylesheet_link_tag :all %> diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index e67be0ae9f..92356edf90 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 |