All threads / Our First API Discussion
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Our First API Discussion

Discussion for Our First API

When should I use rails new my_app --api ? or it's ok to use rails new as usual even if I'm building an API

I´m getting a undefined method `temp' for nil:NilClass when i try to access json.temp @location.recordings.last.temp, I'm confused why this would be as i have the has_many set here is my code if anyone has any input that would be great git code here https://github.com/jrwrest/weather-app

Note: if rake routes doesn't work for you, it is because it has migrated to "rails routes".

Your video ommits the line 'render json: @location, include: ['recordings']' in the locationsController#show

Dear FF, welcome to the forum. Please recognize you email us all when you post here. I looked the the repo due to your non-edited comment. You're referencing a repo from 6 years ago. Code is constantly changing, and we must get used to that fact of life online.

I agree code evolves and so do technology, but I would expect at least a note on differences when things change

There are some things in the source code repository that are different from the video, this is not the quality I expect when paying $19 USD a month for a suscription, I feel disappointed... For sure, my disappointment will grow as you are not responding

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 70,078+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.