Class: Hootenanny::SubscriptionsController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Parameters
Defined in:
app/controllers/hootenanny/subscriptions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
# File 'app/controllers/hootenanny/subscriptions_controller.rb', line 8

def create
  if Hootenanny::Hub.subscribe(subscription_request)
    render :nothing => true, :status => :no_content
  end
rescue Hootenanny::Error => error
  render json:    error,
         status:  :bad_request
end