Skip to content

Commit ff20b65

Browse files
committed
added some bash script lines
title case updated some code
1 parent 541b54e commit ff20b65

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

docs/getting-started/quick-start.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,11 @@ Using this approach, it is super simple to speed up initial page loads without a
12101210

12111211
Want some sugar? How about adding a CSS animation while lazy loading the post list?
12121212

1213+
```bash
1214+
mkdir -p app/javascript/packs/stylesheets
1215+
touch app/javascript/packs/stylesheets/application.scss
1216+
```
1217+
12131218
`app/javascript/packs/stylesheets/application.scss`
12141219

12151220
```css
@@ -1237,12 +1242,16 @@ import "./stylesheets/application.scss";
12371242

12381243
Speaking of fade effects: Let's add a second page in order to show, how you can use Matestacks app and `transition` component in order to implement dynamic page transitions without full browser page reload and without adding any JavaScript!
12391244

1240-
## Implement dynamic page transitions
1245+
## Implement Dynamic Page Transitions
12411246

12421247
We will create a profile page in order to save the username in a session cookie rather than asking for the username on the post form! Obviously, you would use proper user management via something like `devise` in a real world example!
12431248

12441249
* [x] Add an view helper method in order to access the session cookie from a Matestack page
12451250

1251+
```bash
1252+
touch app/helpers/cookie_helper.rb
1253+
```
1254+
12461255
`app/helpers/cookie_helper.rb`
12471256

12481257
```ruby
@@ -1256,7 +1265,8 @@ end
12561265
```
12571266

12581267
* [x] Remove the username input from the post form
1259-
* [x] Remove the toggle components from the post index page; we will add them to the app in a bit enabling the new profile page to trigger them as well!
1268+
* [x] Remove the toggle components from the post index page; we will add them to the app in a moment, enabling the new profile page to trigger them as well!
1269+
* [ ]
12601270

12611271
`app/matestack/twitter_clone/posts/index.rb`
12621272

@@ -1355,22 +1365,20 @@ touch app/matestack/twitter_clone/pages/profile/edit.rb
13551365

13561366
* [x] Add some code to the profile edit page
13571367

1358-
`app/matestack/twitter_clone/pages/profile`
1368+
`app/matestack/twitter_clone/pages/profile/edit.rb`
13591369

13601370
```ruby
13611371
class TwitterClone::Pages::Profile::Edit < Matestack::Ui::Page
13621372

13631373
def response
13641374
div class: "mb-3 p-3 rounded shadow-sm" do
13651375
heading size: 4, text: "Your Profile", class: "mb-3"
1366-
form form_config_helper do
1376+
matestack_form form_config_helper do
13671377
div class: "mb-3" do
13681378
form_input key: :username, type: :text, placeholder: "Username", class: "form-control", init: current_username
13691379
end
13701380
div class: "mb-3" do
1371-
form_submit do
1372-
button type: :submit, class: "btn btn-primary", text: "Save!"
1373-
end
1381+
button 'submit', type: :submit, class: "btn btn-primary", text: "Save!"
13741382
end
13751383
end
13761384
end
@@ -1447,6 +1455,7 @@ class ProfileController < ApplicationController
14471455
def profile_params
14481456
params.require(:profile).permit(:username)
14491457
end
1458+
14501459
end
14511460
```
14521461

@@ -1470,7 +1479,7 @@ class TwitterClone::App < Matestack::Ui::App
14701479
button class: "btn btn-light", text: "Your Profile"
14711480
end
14721481
div class: "mt-5" do
1473-
yield_page
1482+
yield if block_given?
14741483
end
14751484
# add the toggle components here, this way all pages are able to trigger them!
14761485
toggle show_on: "submitted", hide_after: 5000 do

0 commit comments

Comments
 (0)