0

I am trying to build an app using opentok.I am following a tutorial.in tutorial he used a method and called through before_filer.

private
def config_opentok
if @opentok.nil?
 @opentok = OpenTok::OpenTokSDK.new YOUR_API_KEY, YOUR_SECRET_TOKEN
end
end 

when i run the same code it shows..

uninitialized constant GroupsController::Opentok

how to initialize opentok instance variable.i changed YOUR_API_KEY and YOUR_SECRET_TOKEN to my own key and token.and i entered api_key without quotes and secret_token with quotes.

thanks in advance.

vjnan369
  • 833
  • 16
  • 42

1 Answers1

2

You should have the following line in your controller

require "opentok"

And use OpenTok::OpenTok instead of OpenTok::OpenTokSDK

Source

Pavan
  • 33,316
  • 7
  • 50
  • 76