/rails-api-lab

[rails, api, cors, json, angular]

Primary LanguageRuby

Rangular: Build your own Rails API for your Angular app!

Introduction

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.

Exercise

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?

Requirements

  • 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

Deliverable

Please push your API repo to your GitHub account

Additional Resources

Self Evaluation

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?