Перевод "Rails Tutorial"

Michael Hartl, “Rails Tutorial”, public translation into Russian from English More about this translation.

See also 31 similar translations

Translate into another language.

Participants

gafar251 points
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next → next untranslated
1

Rails Tutorial

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

Отметим, что, как и со stylesheet_link_tag (Раздел 4.3.4), мы передаем хэш опций, в данном случае для назначения alt и class атрибутов image tag используются символы :alt и :class. Чтобы прояснить это, давайте посмотрим на HTML который этот тег производит:3

History of edits (Latest: gafar 1 year, 1 month ago) §

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.

Есть несколько способов проверить маршруты, и я собираюсь воспользоваться этой возможностью, чтобы представить интеграционные (объединенные) тесты, которые дают нам возможность симулировать доступ браузера к нашему приложению и таким образом протестировать его из конца в конец (which give us a way to simulate a browser accessing our application and thereby test it from end to end.)(??) Как мы увидим в Разделе 8.4, тестирование маршрутов это только начало.

History of edits (Latest: gafar 1 year, 1 month ago) §

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.)

Обратите внимание, что генератор автоматически добавляет _spec.rb к имени нашего тестового файла, yielding (??) spec/requests/layout_links_spec.rb. (В RSpec, интеграционные тесты накже называют request specs (спецификация запросов); происхождение этой терминологии мне неясно.)

History of edits (Latest: gafar 1 year, 1 month ago) §

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.)

Листинг 5.18 содержит пользовательские маршруты для contact, about, и help страниц; маршрутом для home страницы мы озаботимся в Листинге 5.20. (Раз уж мы будем пользоваться маршрутами из Листинга 5.18 исключительно с этого момента, мы воспользуемся этой возможностью чтобы удалить маршруты контроллера Pages (get "pages/home", и т.д.) последний раз мы их видели в Листинге 3.17.)

History of edits (Latest: gafar 1 year, 1 month ago) §

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.)

Обратите внимание, что about_url это полный URL http://localhost:3000/about (localhost:3000 заменится на доменное имя, например example.com, при полном развертывании сайта). Как уже говорилось в Разделе 5.2, чтобы получить только /about, вы используете about_path. (Rails Tutorial использует path форму для согласования, но разница редко имеет значение на практике (# вот тут вапще ниче не понял - звучит красиво, но имеет ли смысл - ??).)

History of edits (Latest: gafar 1 year, 1 month ago) §
Pages: ← previous Ctrl next → next untranslated
1