thoughtbot / ios-on-rails

A guide to building a Rails API and iOS app
Other
76 stars 6 forks source link

Wrong controller action in geocoded get request chapter #76

Closed StonJarks closed 10 years ago

StonJarks commented 10 years ago

In the Chapter "Creating a geocoded GET request" - controller branching (sad path), you refer to do the branching in the "show" action whereas it should be (and is in the example code) in the "index" action

# app/controllers/api/v1/events/nearests_controller.rb
class Api::V1::Events::NearestsController < ApiController
def show
...
if @events.count(:all) > 0
render
else
render json: { message: 'No Events Found' }, status: 200
end
end
end
jessieay commented 10 years ago

Thanks for pointing this out! I will fix it as soon as I have a chance (no earlier than next week)

If you find yourself with the time, I would love a pull request for this change. :)

jessieay commented 10 years ago

Changes merged at c5f66e8556369df5ef7c3a8336fda9887ff73f66