vergilet / repost

Redirect using POST method
https://vergilet.github.io/repost
MIT License
84 stars 12 forks source link

Error no template found while using Repost::Senpai to redirect API #24

Closed intanpuspita closed 1 year ago

intanpuspita commented 2 years ago

Hi,

I'm trying to use this gems to redirect to other POST action in other controller API. Repost::Senpai.perform('http://xxxx', params: { auth: request.params[:user] }) However I receive this error No template found for xxController#create, rendering head :no_content. I tried to add html.erb in views to solve that error. But after that, the response from my API is the HTML from the view. So it doesn't redirect to action in another controller, but only render the view.

Can anyone give me further explanation of how to use this gems to redirect controller API? I have followed the documentation, but still can't redirect to the POST action

Thank you in advance

vergilet commented 2 years ago

@intanpuspita you can set autosubmit: false and try to debug step by step using default </form/> with post method:

  Repost::Senpai.perform('http://xxxx', params: { auth: request.params[:user] }, options: {autosubmit: false} )