Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit bdf65bc

Browse files
vfonicgitbook-bot
authored andcommitted
GitBook: [docs-linking] 63 pages and 3 assets modified
1 parent 3243af8 commit bdf65bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+220
-193
lines changed
395 KB
Loading
395 KB
Loading

.gitbook/assets/erd.jpg

-504 KB
Binary file not shown.

advanced/deface_overrides_tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module Spree
7171
end
7272
```
7373

74-
Now, when we head to `http://localhost:3000/admin/products` and edit a product, we should be able to set a sale price for the product and be able to view it on our sale page, `http://localhost:3000/sale`. Note that you will likely need to restart our example Spree application \(created in the [Getting Started tutorial](/developer/getting_started/installation.html)\).
74+
Now, when we head to `http://localhost:3000/admin/products` and edit a product, we should be able to set a sale price for the product and be able to view it on our sale page, `http://localhost:3000/sale`. Note that you will likely need to restart our example Spree application \(created in the [Getting Started tutorial](https://github.com/vfonic/spree-dev-docs/tree/bfffab2458d4c7cf8b89a67d42adfad0a96424b7/developer/getting_started/installation.html)\).
7575

7676
### Available actions
7777

@@ -100,7 +100,7 @@ Deface currently supports the following actions:
100100
* :add\_to\_attributes - Appends value to attributes on all elements that match the supplied selector, adds attribute if not present. Expects :attributes option to be passed.
101101
* :remove\_from\_attributes - Removes value from attributes on all elements that match the supplied selector. Expects :attributes option to be passed.
102102

103-
Not all actions are applicable to all elements. For example, \`:insert\_top\` and \`:insert\_bottom\` expects a parent element with children.
103+
Not all actions are applicable to all elements. For example, \`:insert\_top\` and \`:insert\_bottom\` expects a parent element with children.
104104

105105
### Supplying content
106106

@@ -110,7 +110,7 @@ Deface supports three options for supplying content to be used by an override:
110110
* :partial - Relative path to a partial
111111
* :template - Relative path to a template
112112

113-
As Deface operates on the Erb source the content supplied to an override can include Erb, it is not limited to just HTML. You also have access to all variables accessible in the original Erb context.
113+
As Deface operates on the Erb source the content supplied to an override can include Erb, it is not limited to just HTML. You also have access to all variables accessible in the original Erb context.
114114

115115
### Targeting elements
116116

@@ -244,7 +244,7 @@ These warnings are a good indicator that you need to review the source and ensur
244244

245245
Once you've reviewed the new source you can update the `:original` value to new source to clear the warning.
246246

247-
Deface removes all whitespace from both the actual and \`:original\` source values before comparing, to reduce false warnings caused by basic whitespace differences.
247+
Deface removes all whitespace from both the actual and \`:original\` source values before comparing, to reduce false warnings caused by basic whitespace differences.
248248

249249
### Organizing Overrides
250250

advanced/existing_app_tutorial.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 1
66

77
# Adding Spree to an existing Rails application
88

9-
### Add Spree gems to your `Gemfile`
9+
## Add Spree gems to your `Gemfile`
1010

1111
```ruby
1212
gem 'spree' # core and API
@@ -17,18 +17,18 @@ gem 'spree_sample' # dummy data like products, taxons, etc
1717
gem 'spree_auth_devise', '~> 4.3' # Devise integration (optional)
1818
gem 'spree_gateway', '~> 3.9' # payment gateways eg. Stripe, Braintree (optional)
1919
gem 'spree_i18n', '~> 5.0' # translation files (optional)
20-
20+
2121
# only needed for MacOS and Ruby 3.0
2222
gem 'sassc', github: 'sass/sassc-ruby', branch: 'master'
2323
```
2424

25-
### Install gems
25+
## Install gems
2626

2727
```bash
2828
bundle install
2929
```
3030

31-
### Use the install generators to set up Spree
31+
## Use the install generators to set up Spree
3232

3333
```text
3434
bin/rails g spree:install --user_class=Spree::User
@@ -38,7 +38,7 @@ bin/rails g spree:frontend:install
3838
bin/rails g spree:backend:install
3939
```
4040

41-
### Installation options
41+
## Installation options
4242

4343
By default, the installation generator \(`rails g spree:install`\) will run migrations as well as adding seed. This can be disabled using
4444

@@ -55,7 +55,7 @@ bin/rails db:seed
5555
bin/rake spree_sampe:load
5656
```
5757

58-
### Mounting the Spree engine
58+
## Mounting the Spree engine
5959

6060
When `rails g spree:install` is run inside an application, it will install Spree, mounting the `Spree::Core::Engine` component by inserting this line automatically into `config/routes.rb`:
6161

@@ -73,19 +73,19 @@ mount Spree::Core::Engine, at: `/shop`
7373

7474
The different parts of Spree \(API, Admin\) will be mounted there as well, eg. `http://localhost:3000/shop/admin`.
7575

76-
### Use your existing authentication
76+
## Use your existing authentication
7777

7878
[Spree Auth Devise](https://github.com/spree/spree_auth_devise) is the default authentication that comes with Spree but you can swap it for your own, please [follow this guide](../customization/authentication.md)
7979

80-
### Hello, Spree Commerce
80+
## Hello, Spree Commerce
8181

8282
You now have a functional Spree application after running only a few commands!
8383

8484
To see your application in action, open a browser window and navigate to [http://localhost:3000](http://localhost:3000). You should see the Spree default home page:
8585

8686
To stop the webserver, hit Ctrl-C in the terminal window where it's running. In development mode, Spree does not generally require you to stop the server; changes you make in files will be automatically picked up by the server.
8787

88-
#### Logging Into the Admin Panel
88+
### Logging Into the Admin Panel
8989

9090
The next thing you'll probably want to do is to log into the admin interface. Use your browser window to navigate to [http://localhost:3000/admin](http://localhost:3000/admin). You can log in with the username `[email protected]` and password `spree123`.
9191

advanced/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Spree test code is an evolving story. We started out with RSpec, then switch
1717

1818
## Testing Spree Components
1919

20-
Spree consists of several different gems \(see the [Understanding Spree](/developer/getting_started/understanding_spree.html#spree-modules) for more details.\) Each of these gems has its own test suite which can be found in the `spec` directory. Since these gems are also Rails engines, they can't really be tested in complete isolation - they need to be tested within the context of a Rails application.
20+
Spree consists of several different gems \(see the [Understanding Spree](https://github.com/vfonic/spree-dev-docs/tree/bfffab2458d4c7cf8b89a67d42adfad0a96424b7/developer/getting_started/understanding_spree.html#spree-modules) for more details.\) Each of these gems has its own test suite which can be found in the `spec` directory. Since these gems are also Rails engines, they can't really be tested in complete isolation - they need to be tested within the context of a Rails application.
2121

2222
You can easily build such an application by using the Rake task designed for this purpose, running it inside the component you want to test:
2323

customization/api_v1.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ API v1 usage is not recommended anymore and will be extracted from Spree in the
1212

1313
## Introduction
1414

15-
In this tutorial we are going to learn how we can customize the [**REST API**](api) provided by Spree, adding a new endpoint \(or you can override an existing in core\). We will use `spree_simple_sales` extension created in [Extensions tutorial](../extensions/extensions_tutorial.md). If you haven't seen before, please check them!
15+
In this tutorial we are going to learn how we can customize the [**REST API**](https://github.com/vfonic/spree-dev-docs/tree/bfffab2458d4c7cf8b89a67d42adfad0a96424b7/customization/api/README.md) provided by Spree, adding a new endpoint \(or you can override an existing in core\). We will use `spree_simple_sales` extension created in [Extensions tutorial](../extensions/extensions_tutorial.md). If you haven't seen before, please check them!
1616

1717
## Adding Custom Endpoints
1818

@@ -49,7 +49,7 @@ module Spree
4949
end
5050
```
5151

52-
Note that distinct of \`Spree::HomeController\` from the previous tutorial, we are extending from \`Spree::Api\` module now
52+
Note that distinct of \`Spree::HomeController\` from the previous tutorial, we are extending from \`Spree::Api\` module now
5353

5454
The difference from `Spree::HomeController.home` action is the 3 last extra lines, that perform:
5555

@@ -73,7 +73,7 @@ Spree::Core::Engine.add_routes do
7373
end
7474
```
7575

76-
The \`only:\` symbol defines which actions of the controller are allowed to be endpoints. Whether you don't define this, Spree will try execute a \`SalesController.show\(\)\` action method, that in this case, not exists!
76+
The \`only:\` symbol defines which actions of the controller are allowed to be endpoints. Whether you don't define this, Spree will try execute a \`SalesController.show\(\)\` action method, that in this case, not exists!
7777

7878
### Creating a View
7979

@@ -95,7 +95,7 @@ attributes *product_attributes << :sale_price
9595

9696
### Testing Our endpoint
9797

98-
Like described in [Testing Our Decorator](/developer/advanced/extensions_tutorial.html#testing-our-decorator) it's always a good idea to test your code, including your api new/changed endpoints. Let's write a integration test that simulate your api of simple unit tests for `sales_controller.rb`
98+
Like described in [Testing Our Decorator](https://github.com/vfonic/spree-dev-docs/tree/bfffab2458d4c7cf8b89a67d42adfad0a96424b7/developer/advanced/extensions_tutorial.html#testing-our-decorator) it's always a good idea to test your code, including your api new/changed endpoints. Let's write a integration test that simulate your api of simple unit tests for `sales_controller.rb`
9999

100100
#### Creating and running the test
101101

@@ -179,5 +179,5 @@ api_key = user.spree_api_key # Copy the api_key value
179179

180180
Now, when we head to `http://localhost:3000/api/v1/sales`, passing the header `X-Spree-Token: [YOUR_COPIED_API_KEY]`, \(or add a `?token=[YOUR_COPIED_API_KEY]` to the url\) into your browser or any REST client, we should see the json result with all products with a sale price.
181181

182-
Note that you will likely need to restart our example Spree application \(created in the \[Getting Started\]\(/developer/getting\_started/installation.html\) tutorial\).
182+
Note that you will likely need to restart our example Spree application \(created in the \[Getting Started\]\(/developer/getting\_started/installation.html\) tutorial\).
183183

customization/api_v2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ description: This page covers customization of both Storefront API and Platform
1111

1212
### Customizing JSON response
1313

14-
Spree uses J[SON API serializers](https://github.com/jsonapi-serializer/jsonapi-serializer) to represent data returned by API endpoints.
14+
Spree uses J[SON API serializers](https://github.com/jsonapi-serializer/jsonapi-serializer) to represent data returned by API endpoints.
1515

16-
You can easily swap OOTB Spree serializers with your own thanks to [Spree Dependencies](dependencies.md).
16+
You can easily swap OOTB Spree serializers with your own thanks to [Spree Dependencies](dependencies.md).
1717

1818
#### Adding custom attributes
1919

@@ -48,7 +48,7 @@ Let's create a new serializer `app/serializers/video_serializer.rb`:
4848
```ruby
4949
class VideoSerializer < Spree::Api::V2::BaseSerializer
5050
set_type: :video
51-
51+
5252
attributes :url
5353
end
5454
```
@@ -58,7 +58,7 @@ Now in your `app/serializers/my_product_serializer.rb`
5858
```ruby
5959
class MyProductSerializer < Spree::V2::Storefront::ProductSerializer
6060
attribute :my_new_custom_attribute
61-
61+
6262
has_many :videos, serializer: :video
6363
end
6464
```

customization/authentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Each of the methods defined in this module return values that are the most commo
116116

117117
application.
118118

119-
URLs inside the \`spree\_login\_path\`, \`spree\_signup\_path\` and \`spree\_logout\_path\` methods \*\*must\*\* have \`main\_app\` prefixed if they are inside your application. This is because Spree will otherwise attempt to route to a \`login\_path\`, \`signup\_path\` or \`logout\_path\` inside of itself, which does not exist. By prefixing with \`main\_app\`, you tell it to look at the application's routes.
119+
URLs inside the \`spree\_login\_path\`, \`spree\_signup\_path\` and \`spree\_logout\_path\` methods \*\*must\*\* have \`main\_app\` prefixed if they are inside your application. This is because Spree will otherwise attempt to route to a \`login\_path\`, \`signup\_path\` or \`logout\_path\` inside of itself, which does not exist. By prefixing with \`main\_app\`, you tell it to look at the application's routes.
120120

121121
You will need to define the `login_path`, `signup_path` and `logout_path` routes yourself, by using code like this inside your application's `config/routes.rb` if you're using Devise:
122122

@@ -133,7 +133,7 @@ Of course, this code will be different if you're not using Devise. Simply **do n
133133

134134
You can also customize the `spree_login_path`, `spree_signup_path` and `spree_logout_path` methods inside `lib/spree/authentication_helpers.rb` to use the routing helper methods already provided by the authentication setup you have, if you wish.
135135

136-
Any modifications made to \`lib/spree/authentication\_helpers.rb\` while the server is running will require a restart, as with any other modification to other files in \`lib\`.
136+
Any modifications made to \`lib/spree/authentication\_helpers.rb\` while the server is running will require a restart, as with any other modification to other files in \`lib\`.
137137

138138
## The User Model
139139

@@ -170,9 +170,9 @@ Finally, if you are using the API component of Spree, there are more methods add
170170

171171
## Login link
172172

173-
This is only applicable for Spree 4.0 and older. Spree 4.1 and newer releases handle this out of the box.
173+
This is only applicable for Spree 4.0 and older. Spree 4.1 and newer releases handle this out of the box.
174174

175-
To make the login link appear on Spree pages, you will need to modify `spree/shared/_nav_bar.html.erb` file which you can copy over from Spree codebase to your project \(detailed in [View Customization section](/developer/customization/view.html)\).
175+
To make the login link appear on Spree pages, you will need to modify `spree/shared/_nav_bar.html.erb` file which you can copy over from Spree codebase to your project \(detailed in [View Customization section](https://github.com/vfonic/spree-dev-docs/tree/bfffab2458d4c7cf8b89a67d42adfad0a96424b7/developer/customization/view.html)\).
176176

177177
You will need to add this code:
178178

0 commit comments

Comments
 (0)