From e5bd4adce9a564302bede02ac93dc967e69df73c Mon Sep 17 00:00:00 2001 From: Yoshiyuki Hirano Date: Sat, 31 Mar 2018 23:36:23 +0900 Subject: [PATCH] Put images into each page's dir in guides --- .../{ => 4_0_release_notes}/rails4_features.png | Bin .../{ => association_basics}/belongs_to.png | Bin .../images/{ => association_basics}/habtm.png | Bin .../images/{ => association_basics}/has_many.png | Bin .../{ => association_basics}/has_many_through.png | Bin .../images/{ => association_basics}/has_one.png | Bin .../{ => association_basics}/has_one_through.png | Bin .../{ => association_basics}/polymorphic.png | Bin guides/assets/images/{ => security}/csrf.png | Bin .../images/{ => security}/session_fixation.png | Bin guides/source/4_0_release_notes.md | 2 +- guides/source/association_basics.md | 14 +++++++------- guides/source/security.md | 4 ++-- 13 files changed, 10 insertions(+), 10 deletions(-) rename guides/assets/images/{ => 4_0_release_notes}/rails4_features.png (100%) rename guides/assets/images/{ => association_basics}/belongs_to.png (100%) rename guides/assets/images/{ => association_basics}/habtm.png (100%) rename guides/assets/images/{ => association_basics}/has_many.png (100%) rename guides/assets/images/{ => association_basics}/has_many_through.png (100%) rename guides/assets/images/{ => association_basics}/has_one.png (100%) rename guides/assets/images/{ => association_basics}/has_one_through.png (100%) rename guides/assets/images/{ => association_basics}/polymorphic.png (100%) rename guides/assets/images/{ => security}/csrf.png (100%) rename guides/assets/images/{ => security}/session_fixation.png (100%) diff --git a/guides/assets/images/rails4_features.png b/guides/assets/images/4_0_release_notes/rails4_features.png similarity index 100% rename from guides/assets/images/rails4_features.png rename to guides/assets/images/4_0_release_notes/rails4_features.png diff --git a/guides/assets/images/belongs_to.png b/guides/assets/images/association_basics/belongs_to.png similarity index 100% rename from guides/assets/images/belongs_to.png rename to guides/assets/images/association_basics/belongs_to.png diff --git a/guides/assets/images/habtm.png b/guides/assets/images/association_basics/habtm.png similarity index 100% rename from guides/assets/images/habtm.png rename to guides/assets/images/association_basics/habtm.png diff --git a/guides/assets/images/has_many.png b/guides/assets/images/association_basics/has_many.png similarity index 100% rename from guides/assets/images/has_many.png rename to guides/assets/images/association_basics/has_many.png diff --git a/guides/assets/images/has_many_through.png b/guides/assets/images/association_basics/has_many_through.png similarity index 100% rename from guides/assets/images/has_many_through.png rename to guides/assets/images/association_basics/has_many_through.png diff --git a/guides/assets/images/has_one.png b/guides/assets/images/association_basics/has_one.png similarity index 100% rename from guides/assets/images/has_one.png rename to guides/assets/images/association_basics/has_one.png diff --git a/guides/assets/images/has_one_through.png b/guides/assets/images/association_basics/has_one_through.png similarity index 100% rename from guides/assets/images/has_one_through.png rename to guides/assets/images/association_basics/has_one_through.png diff --git a/guides/assets/images/polymorphic.png b/guides/assets/images/association_basics/polymorphic.png similarity index 100% rename from guides/assets/images/polymorphic.png rename to guides/assets/images/association_basics/polymorphic.png diff --git a/guides/assets/images/csrf.png b/guides/assets/images/security/csrf.png similarity index 100% rename from guides/assets/images/csrf.png rename to guides/assets/images/security/csrf.png diff --git a/guides/assets/images/session_fixation.png b/guides/assets/images/security/session_fixation.png similarity index 100% rename from guides/assets/images/session_fixation.png rename to guides/assets/images/security/session_fixation.png diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 0921cd1979..a1a6a225b2 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -55,7 +55,7 @@ $ ruby /path/to/rails/railties/bin/rails new myapp --dev Major Features -------------- -[![Rails 4.0](images/rails4_features.png)](http://guides.rubyonrails.org/images/rails4_features.png) +[![Rails 4.0](images/4_0_release_notes/rails4_features.png)](http://guides.rubyonrails.org/images/4_0_release_notes/rails4_features.png) ### Upgrade diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index f895cadea5..860a1e1cba 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -94,7 +94,7 @@ class Book < ApplicationRecord end ``` -![belongs_to Association Diagram](images/belongs_to.png) +![belongs_to Association Diagram](images/association_basics/belongs_to.png) NOTE: `belongs_to` associations _must_ use the singular term. If you used the pluralized form in the above example for the `author` association in the `Book` model, you would be told that there was an "uninitialized constant Book::Authors". This is because Rails automatically infers the class name from the association name. If the association name is wrongly pluralized, then the inferred class will be wrongly pluralized too. @@ -127,7 +127,7 @@ class Supplier < ApplicationRecord end ``` -![has_one Association Diagram](images/has_one.png) +![has_one Association Diagram](images/association_basics/has_one.png) The corresponding migration might look like this: @@ -171,7 +171,7 @@ end NOTE: The name of the other model is pluralized when declaring a `has_many` association. -![has_many Association Diagram](images/has_many.png) +![has_many Association Diagram](images/association_basics/has_many.png) The corresponding migration might look like this: @@ -213,7 +213,7 @@ class Patient < ApplicationRecord end ``` -![has_many :through Association Diagram](images/has_many_through.png) +![has_many :through Association Diagram](images/association_basics/has_many_through.png) The corresponding migration might look like this: @@ -299,7 +299,7 @@ class AccountHistory < ApplicationRecord end ``` -![has_one :through Association Diagram](images/has_one_through.png) +![has_one :through Association Diagram](images/association_basics/has_one_through.png) The corresponding migration might look like this: @@ -340,7 +340,7 @@ class Part < ApplicationRecord end ``` -![has_and_belongs_to_many Association Diagram](images/habtm.png) +![has_and_belongs_to_many Association Diagram](images/association_basics/habtm.png) The corresponding migration might look like this: @@ -494,7 +494,7 @@ class CreatePictures < ActiveRecord::Migration[5.0] end ``` -![Polymorphic Association Diagram](images/polymorphic.png) +![Polymorphic Association Diagram](images/association_basics/polymorphic.png) ### Self Joins diff --git a/guides/source/security.md b/guides/source/security.md index b419f7b48d..ffd7e66fc5 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -217,7 +217,7 @@ The best _solution against it is not to store this kind of data in a session, bu NOTE: _Apart from stealing a user's session ID, the attacker may fix a session ID known to them. This is called session fixation._ -![Session fixation](images/session_fixation.png) +![Session fixation](images/security/session_fixation.png) This attack focuses on fixing a user's session ID known to the attacker, and forcing the user's browser into using this ID. It is therefore not necessary for the attacker to steal the session ID afterwards. Here is how this attack works: @@ -272,7 +272,7 @@ Cross-Site Request Forgery (CSRF) This attack method works by including malicious code or a link in a page that accesses a web application that the user is believed to have authenticated. If the session for that web application has not timed out, an attacker may execute unauthorized commands. -![](images/csrf.png) +![](images/security/csrf.png) In the [session chapter](#sessions) you have learned that most Rails applications use cookie-based sessions. Either they store the session ID in the cookie and have a server-side session hash, or the entire session hash is on the client-side. In either case the browser will automatically send along the cookie on every request to a domain, if it can find a cookie for that domain. The controversial point is that if the request comes from a site of a different domain, it will also send the cookie. Let's start with an example: