Now that we've seen how Rails API mode works, lets build out our own Flash Cards API using Rails and hook it up to our flashcards Angular app!
Note: This can be a pair programming activity or done independently.
Try this without the use of scaffold this time! Scaffold in API mode, with the active_model_serializers gem creates a model, migrations, a controller and the serializer. Can you make these each individually?
- Create a Rails API
- Use version control
- Use rack-cors to allow your Angular app to access your API
- Use curl to POST some flash cards to populate the API
- Replace the URL in your Angular app to get data from the Angular back end
Bonus:
- Add a second resource to your Angular app and API
Please push your API repo to your GitHub account
- A thorough blog post on API best practices
- Another perspective on API best practices
- rack-cors
- rails-api
During the previous exercise, rate your progress on a scale of 1-5 (5 being the highest) for the following criteria:
- Persistence: Do you handle frustration well? Do you independently pursue understanding?
- Organization: Do you thoughtfully implement best coding patterns and practices?
- Collaboration: Do you make an effort solve problems and share your ideas with others?
- Communication: Do you clearly convey your thoughts to others in illustrative and clear ways?
- Self-compassion: Do you make productive use of turning failures into learning opportunities?
- Resourcefulness: Do make an effort to compare and contrast new ideas with ones you already know?