Closed davidtlee closed 9 years ago
You want to set it up in the environments file, with your dev cert in your development environment and prod cert in your production environment (Rails.root / config / environments).
To run use a delayed job of some sort, e.g. sidekiq.
You should read Rails best practices, but in general anything that goes off system, for which the user is not expecting an immediate response, goes into a queue of some sort.
In general, Rails best practices dictates that logic be moved from a controller to a model and/or help and/or task/job/runner.
Thanks, @kaneda.
Rails 4.2 brought us Active Job. @davidtlee You might want to look into that, when you’re following the advice of @kaneda.
Got it, thanks @kaneda, @mattt, and @j4zz! :)
This is quite a noob question as I'm still pretty new to rails. I'm wondering where's the right place to do the basic setup for houston? i.e. if I want to send a push notification in a controller, where is the right place to set up the APN code below:
Do I do it directly in that controller file? That seems wrong... Do I do it in an initializer file? Is it ok to simply just create an arbitrary file within the initializers directory? Thanks a lot!