View receive.rb
# Credentials
AWS.config(access_key_id: ENV['AWS_KEY_ID'], secret_access_key: ENV['AWS_ACCESS_KEY'])
# Get the queue
sqs = AWS::SQS.new
queue = sqs.queues.create('search-service-uat')
# This will run forever, listening for messages and processing them
queue.poll do |message|
event = Hashie::Mash.new(JSON.parse(message.body))
View playbook1.json
{
"playbook": {
"name": "{{lang 'name'}}",
"_id": "playbook1",
"language": {
"en-US": {
"name": "Marketing Playbook 1"
},
"phases": ["phase1", "phase2"],
"type": "playbook"
View application_controller.rb
class ApplicationController < ActionController::Base
before_filter :define_resource_params, if: :devise_controller?
protected
def define_resource_params
if ((self.class <= Devise::PasswordsController) || (self.class <= Devise::RegistrationsController))
self.class.send(:define_method, :resource_params) do
params.require(resource_name).permit(:email, :password, :password_confirmation)
end