Skip to content

Commit

Permalink
Merge pull request #2037 from ember-learn/super-rentals-tutorial
Browse files Browse the repository at this point in the history
Tutorial Updates
  • Loading branch information
mansona authored Jul 3, 2024
2 parents 2c70c1a + 26e88bd commit 706959f
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 17 deletions.
18 changes: 9 additions & 9 deletions guides/release/tutorial/part-1/component-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ When invoking a component, Ember will replace the component tag with the content

Let's try it out by editing the index template:

```js { data-filename="app/templates/index.hbs" data-diff="-1,-2,+3,-7,+8" }
```handlebars { data-filename="app/templates/index.hbs" data-diff="-1,-2,+3,-7,+8" }
<div class="jumbo">
<div class="right tomster"></div>
<Jumbo>
Expand All @@ -79,7 +79,7 @@ After saving the changes, your page should automatically reload, and, _voilà_..

Let's do the same for our other two pages as well.

```js { data-filename="app/templates/about.hbs" data-diff="-1,-2,+3,-11,+12" }
```handlebars { data-filename="app/templates/about.hbs" data-diff="-1,-2,+3,-11,+12" }
<div class="jumbo">
<div class="right tomster"></div>
<Jumbo>
Expand All @@ -94,7 +94,7 @@ Let's do the same for our other two pages as well.
</Jumbo>
```

```js { data-filename="app/templates/contact.hbs" data-diff="-1,-2,+3,-19,+20" }
```handlebars { data-filename="app/templates/contact.hbs" data-diff="-1,-2,+3,-19,+20" }
<div class="jumbo">
<div class="right tomster"></div>
<Jumbo>
Expand Down Expand Up @@ -205,7 +205,7 @@ We can create a `<NavBar>` component at `app/components/nav-bar.hbs`:
Next, we will add our `<NavBar>` component to the top of each page:
```js { data-filename="app/templates/about.hbs" data-diff="+1" }
```habdlebars { data-filename="app/templates/about.hbs" data-diff="+1" }
<NavBar />
<Jumbo>
<h2>About Super Rentals</h2>
Expand All @@ -218,7 +218,7 @@ Next, we will add our `<NavBar>` component to the top of each page:
</Jumbo>
```
```js { data-filename="app/templates/contact.hbs" data-diff="+1" }
```habdlebars { data-filename="app/templates/contact.hbs" data-diff="+1" }
<NavBar />
<Jumbo>
<h2>Contact Us</h2>
Expand All @@ -239,7 +239,7 @@ Next, we will add our `<NavBar>` component to the top of each page:
</Jumbo>
```
```js { data-filename="app/templates/index.hbs" data-diff="+1" }
```handlebars { data-filename="app/templates/index.hbs" data-diff="+1" }
<NavBar />
<Jumbo>
<h2>Welcome to Super Rentals!</h2>
Expand Down Expand Up @@ -363,7 +363,7 @@ While we are at it, we will also add a container element that wraps around the w
</div>
```

```js { data-filename="app/templates/index.hbs" data-diff="-1" }
```handlebars { data-filename="app/templates/index.hbs" data-diff="-1" }
<NavBar />
<Jumbo>
<h2>Welcome to Super Rentals!</h2>
Expand All @@ -372,7 +372,7 @@ While we are at it, we will also add a container element that wraps around the w
</Jumbo>
```

```js { data-filename="app/templates/contact.hbs" data-diff="-1" }
```handlebars { data-filename="app/templates/contact.hbs" data-diff="-1" }
<NavBar />
<Jumbo>
<h2>Contact Us</h2>
Expand All @@ -393,7 +393,7 @@ While we are at it, we will also add a container element that wraps around the w
</Jumbo>
```

```js { data-filename="app/templates/about.hbs" data-diff="-1" }
```handlebars { data-filename="app/templates/about.hbs" data-diff="-1" }
<NavBar />
<Jumbo>
<h2>About Super Rentals</h2>
Expand Down
2 changes: 1 addition & 1 deletion guides/release/tutorial/part-1/more-about-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The test should pass.
Finally, let's invoke this a couple of times from our index template to populate the page.
```js { data-filename="app/templates/index.hbs" data-diff="+6,+7,+8,+9,+10,+11,+12,+13" }
```handlebars { data-filename="app/templates/index.hbs" data-diff="+6,+7,+8,+9,+10,+11,+12,+13" }
<Jumbo>
<h2>Welcome to Super Rentals!</h2>
<p>We hope you find exactly what you're looking for in a place to stay.</p>
Expand Down
11 changes: 5 additions & 6 deletions guides/release/tutorial/part-2/ember-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,19 @@ Running "lint:fix" script...

The generator created some boilerplate code for us, which serves as a pretty good starting point for writing our test:

```js { data-filename="tests/unit/models/rental-test.js" data-diff="-8,-9,+10,-12,-13,+14,+15,+16,+17,+18,+19,+20,+21,+22,+23,+24,+25,+26,+27,+28,+29,+30,+31,+32,+33,+34,+35,+36,+37,+38,+39,+40,+41,+42,+43" }
import { module, test } from 'qunit';

```js { data-filename="tests/unit/models/rental-test.js" data-diff="-7,-8,+9,-11,-12,+13,+14,+15,+16,+17,+18,+19,+20,+21,+22,+23,+24,+25,+26,+27,+28,+29,+30,+31,+32,+33,+34,+35,+36,+37,+38,+39,+40,+41,+42" }
import { setupTest } from 'super-rentals/tests/helpers';
import { module, test } from 'qunit';

module('Unit | Model | rental', function (hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function (assert) {
test('it has the right type', function (assert) {
let store = this.owner.lookup('service:store');
let model = store.createRecord('rental', {});
assert.ok(model);
const store = this.owner.lookup('service:store');
const model = store.createRecord('rental', {});
assert.ok(model, 'model exists');
let rental = store.createRecord('rental', {
id: 'grand-old-mansion',
title: 'Grand Old Mansion',
Expand Down
2 changes: 1 addition & 1 deletion guides/release/tutorial/part-2/route-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Notice that we are doing something a little different here. Instead of using the

Now that we have this route in place, we can update our `<Rental>` component to actually _link_ to each of our detailed rental properties!

```js { data-filename="app/components/rental.hbs" data-diff="-7,+8,+9,+10,+11,+12" }
```handlebars { data-filename="app/components/rental.hbs" data-diff="-7,+8,+9,+10,+11,+12" }
<article class="rental">
<Rental::Image
src={{@rental.image}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-1/working-with-data/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-2/ember-data/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-2/ember-data/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-2/ember-data/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...ic/images/tutorial/part-2/provider-components/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ...ages/tutorial/part-2/provider-components/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-2/route-params/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/tutorial/part-2/route-params/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 706959f

Please sign in to comment.