How to Make a Single Page Application (SPA) with Cape.JS and Rails - A Tutorial
Preface
By reading through this tutorial, you can learn how to construct Single Page Applications (SPAs) combining the Cape.JS as front-end framework with the Ruby on Rails as back-end framework.
This tutorial is based on the Cape.JS 1.5 and Ruby on Rails 5.0.0.rc1.
Legend
A boxed text whose each line begins with a dollar sign ($
) denotes that readers
should enter this text into your shell in order to run commands:
$ mkdir -p foo/bar
$ cd foo/bar
Note that the dollar signs ($
) at the beginning of each line stand for command prompts.
You must omit them when you enter the text into your shell.
Table of Contents
- Setting up
- Creating the Top Page
- Showing the Reception Component
- Navigation Among Pages
- Rendering an HTML Form
- Models and Resources
- Collection Agent
- Showing Error Messages
- Refactoring with Partials
- Listing Registered Visitors
Source Code
You can get the source code of demo app from https://github.com/capejs/greeter-demo.