luk4s / mautic-rails

Mautic ruby client / wrapper
MIT License
23 stars 23 forks source link

Problems with configuration #9

Closed rodrigocvb closed 4 years ago

rodrigocvb commented 5 years ago

@luk4s I'm not understanding the configuration process described in the readme file. I'd appreciate if you could give me some insights.

What I've done so far:

  1. Add API oauth2 login with URI callback "http://localhost:3000/mautic/connections/1/oauth2". I put :ID = 1, but I don't know if it's right. I didn't understand where I get this ID from.

  2. Add config/initializers/mautic.rb file

  3. Add "mount Mautic::Engine => "/mautic" to the end of config/routes.rb

  4. Try to call m = Mautic::Connection.last from app and I get: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "mautic_connections" does not exist LINE 1: SELECT "mautic_connections".* FROM "mautic_connections" ORDE...

I don't know if/where should I use the public and secret keys. I don't know where I get this id from. If you could help me with some tips it would be great. Thanks!

luk4s commented 4 years ago

Hello, I update readme. Added more detail instructions. But when you check code of gem it will be clear.

When you add gem to your app, you need run rails db:migrate, because connection are stored in new tables.

:ID is id of Mautic::Connection , which you need to create first.

Let me know if detail readme helps.

thx