Frage

I have 2 ruby on rails projects, one that has a form and posts it to the another project. The another project should then convert it to a model, quotation, and save it.

Ive made a quotation resource and a controller with a create method. The form's action is other-project/quotations and method post. From what I understand this should call the create method in the quotation controller.

However I am getting this error:

The change you wanted was rejected.
Maybe you tried to change something you didn't have access to.

Anyone know what is causing this error? Is it heroku-caused or does it have something to do with my applications? I'm fairly new to rails/heroku so I'm unsure, any help would be appreciated.

Edit 1 After some research it seems I need the authenticity tokens to match. However since I have two apps, how is this achieved?

War es hilfreich?

Lösung

Ok so after checking heroku logs it does seem to be an issue with CSRF. When I commented out the protect from forgery line in both apps it worked fine and I was able to send data between them.
Will need to some research into whether this is sensible thing to do (guessing not). Thanks for the tips everyone.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top