Rails Tutorial
Translations of this material:
- into Russian: Перевод "Rails Tutorial". 80% translated in draft. Almost done, let's finish it!
-
Submitted for translation by gafar 30.03.2011
Text
1) div тег в HTML это generic division (# "родовое отделение" — если верить автопереводчику :) ); он не делает ничего, кроме разделения документа на отдельные части.
2) Note that, as with stylesheet_link_tag (Section 4.3.4), we pass a hash of options, in this case setting the alt and class attributes of the image tag using symbols :alt and :class. To make this clearer, let’s look at the HTML this tag produces:3
3) There are several ways to test routes, and we’re going to take this opportunity to introduce integration tests, which give us a way to simulate a browser accessing our application and thereby test it from end to end. As we’ll see starting in Section 8.4, testing routes is just the beginning.
4) Note that the generator automatically appends _spec.rb to the name of our test file, yielding spec/requests/layout_links_spec.rb. (In RSpec, integration tests are also called request specs; the origins of this terminology are obscure to me.)
5) Listing 5.18 contains custom routes for the contact, about, and help pages; we’ll take care of the home page itself in Listing 5.20. (SiNote that about_url is the full URL http://localhost:3000/about (with localhost:3000 being replaced with the domain name, such as example.com, for a fully deployed site). As discussed in Section 5.2, to get just /about, you use about_path. (Rails Tutorial uses the path form for consistency, but the difference rarely matters in practice.)nce we’ll be using the custom routes in Listing 5.18 exclusively from now on, we’ve taken this opportunity to remove the Pages controller routes (get "pages/home", etc.) last seen in Listing 3.17.)
6) Note that about_url is the full URL http://localhost:3000/about (with localhost:3000 being replaced with the domain name, such as example.com, for a fully deployed site). As discussed in Section 5.2, to get just /about, you use about_path. (Rails Tutorial uses the path form for consistency, but the difference rarely matters in practice.)
