|
1 | 1 | # Essential Guide 4: Forms & Actions (Create, Update, Delete) |
2 | 2 |
|
| 3 | +Demo: [Matestack Demo](https://demo.matestack.io)<br> |
| 4 | +Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application) |
| 5 | + |
3 | 6 | Welcome to the fourth part of our essential guide about building a web application with matestack. |
4 | 7 |
|
5 | 8 | ## Introduction |
@@ -169,7 +172,7 @@ The 'success' key let's us define a behavior when the form was submitted success |
169 | 172 | Inside our form component we have calls to normal html components like `label, br, button` which render the corresponding html tag and we have calls for form inputs and a form submit. Let's take a closer look at the `form_input` call. A form input at least requires a key and a type. The type can be any html input type possible. The key defines the input name as which it will get submitted. If the model specified by the `for` key in the form config responds to the key the input will be prefilled with the value the model returns. `form_radio, form_select, form_checkbox` helpers can take an array or hash in the `options` key. They render for example a radio button for each option in the array or hash. In case of an array the label and value are the same for each radio button, in case of a hash the keys are used as labels and the values as values. |
170 | 173 | To enable the user to submit the form, we added a button to click. This button needs to be wrapped inside a `form_submit` call, which will take care of triggering the form submit if the contents inside the given block is clicked. |
171 | 174 |
|
172 | | -To learn more, check out the [complete API documentation](docs/api/2-components/form.md) for the `form` component. |
| 175 | +To learn more, check out the [complete API documentation](/docs/api/2-components/form.md) for the `form` component. |
173 | 176 |
|
174 | 177 | Take a moment to familiarize yourself with everything going on and then go ahead and create another page in `app/matestack/demo/pages/persons/edit.rb`, featuring similar content: |
175 | 178 |
|
@@ -240,7 +243,7 @@ Beyond that, here's some suggestions of what you could try to add in the future: |
240 | 243 | - using other Ruby objects than ActiveRecord collections |
241 | 244 | - fetching data from and sending data to third party APIs |
242 | 245 |
|
243 | | -To learn more, check out the [complete API documentation](docs/api/2-components/form.md) for the `form` component. |
| 246 | +To learn more, check out the [complete API documentation](/docs/api/2-components/form.md) for the `form` component. |
244 | 247 |
|
245 | 248 | ## Adding a delete button for persons |
246 | 249 |
|
@@ -290,7 +293,7 @@ Beyond that, here's some suggestions of what you could try to add in the future: |
290 | 293 | - sending an advanced payload with the HTTP request |
291 | 294 | - re-rendering parts of a page on successful request |
292 | 295 |
|
293 | | -To learn more, check out the [complete API documentation](docs/api/2-components/action.md) for the `action` component. |
| 296 | +To learn more, check out the [complete API documentation](/docs/api/2-components/action.md) for the `action` component. |
294 | 297 |
|
295 | 298 | ## Local testing |
296 | 299 |
|
|
0 commit comments