Class: CheckinsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/foursquare/push/templates/controllers/checkins_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
# File 'lib/generators/foursquare/push/templates/controllers/checkins_controller.rb', line 4

def create
  checkin = JSON.parse(params['checkin'])
  # TODO: verify push secret
  user = FoursquareUser.find_by_foursquare_id(checkin['user']['id'])
  user.client.create_checkin_reply(checkin['id'], text: "hello world!")
  return head :ok
end